MimeType wrong when sending image to S3 with Laravel

1

I'm using Laravel 5.3 and sending images to Amazon S3.

I have already put the rules in the bucket so that it is public and I'm sending the image as follows:

request()->file('avatar')->storeAs('uploads/143', 'avatar.jpg', 's3');

The file is being sent normally to S3 but does not send with the correct mimetype. In the example above the mimetype of the file would be image/jpeg but when viewing directly through the Amazon S3 panel the file is with mimetype application/octet-stream

This makes the file, when accessed, open the browser's save window and does not simply display the file as expected.

I did not find a way to set mimetype or fix this in bucket settings.

    
asked by anonymous 22.09.2016 / 16:05

0 answers