Bref: Image uploaded to S3 gets corrupted

Created on 15 Mar 2019  路  2Comments  路  Source: brefphp/bref

I'm making a serverless laravel application, and i need to be able to upload images to S3 via form. I tested locally and it uploads and retrieves the image just fine from S3, but when i try the same code in my serverless application, the uploaded file in S3 arrives corrupted.

That's the code i'm using to upload the images:
upload

I tried uploading other types of files, but all of them arrive corrupted in S3, except for txt.
I already searched a lot and couldn't understand the reason of this.

Most helpful comment

Just found the solution for my problem. I had to go to API Gateway, and under Settings add the media binary type multipart/form-data, save and redeploy the API. After that the upload worked!

All 2 comments

Just found the solution for my problem. I had to go to API Gateway, and under Settings add the media binary type multipart/form-data, save and redeploy the API. After that the upload worked!

Yes it works thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlfbrito picture tlfbrito  路  4Comments

claudiunicolaa picture claudiunicolaa  路  3Comments

eddiejan picture eddiejan  路  7Comments

zemiacsik picture zemiacsik  路  8Comments

kwn picture kwn  路  8Comments