This topic is locked
[SOLVED]

S3 "uploading failed" in app, but file is uploaded to S3 bucket

3/13/2022 2:28:04 AM
PHPRunner General questions
S
seedavidwork author

I have a new PHP Runner running on AWS west 2 that I built to play with the S3 upload featurs. My DB field called files is set to LONGTEXT. When I run the app and try to upload a file, I get a dialouge in the app that says "Uploading failed" but the file is actually stored to S3 ( viewable from my AWS control panel or a desktop S3 tool ). The database filed for the file upload has no content, the value is NULL. The other fields from the same record are saved correctly. I am looking for any advice or solutions.

I have added the Cross-origin resource sharing (CORS) as directed in the instrcutions.

S
seedavidwork author 3/13/2022

It looks like the full files are not being uploaded as I thought before. The file size from files uploaded from the app into AWS S3 is 16bytes. I can use a desktop tool to upload larger files to the same bucket using the same login without any trouble. As I mentioend above, there is no data in the database field.

I have also discovered that uploads are failing to using the old message of copying them to the web folder.

I am using NGINX and PHP 8 if this makes a difference. I have tried to set adequete file upload permessions in both servers.

Admin 3/14/2022

Are you getting the same issue running your application locally or on Demo Account?

S
seedavidwork author 3/14/2022

I had not tried this applicaion locally, but I just buit it on my local dev server and I get the same error for file upload to the local server and to S3. The local server is a place I have build older projects ( before the s3 option ) but the file upload to the server always worked perfectly. It feels more like the problem is realated to my webapp and not the enviournemnt. The local server is running Apache and PHP 7.

When I dowload one of the files that got posted from the web app to s3 with only 16b I see the following data inside the file "RunnerFileSystem"

Admin 3/15/2022

You need to test this application both locally and on Demo Account. If this error is reproducible on Demo Account then it is definitely an environment issue but something else. In this case you would need to contact support team directly sending the URL of your prject on Demo Account along with instructions on reproducing the issue there.

Admin 3/15/2022

The issue turned out to be an unsupported S3 bucket name with a dot in it. A new bucket without a dot in its name will solve the issue.

S
seedavidwork author 3/16/2022

This has been tested on the demo server and on my production server and it did indeed fix the issue.