dmag's avatar
Level 6

s3 upload pdf file mime type problem

When uploading a pdf file to s3 via Storage::put(), the file's mime type is changing from application/pdf to application/octet-stream.

If I swap s3 storage for local, no issues occur.

0 likes
1 reply
click's avatar
click
Best Answer
Level 35

Try passing the mimetype your self

Storage::put($fileName, $contents, [
   'mimetype' => 'application/pdf',
]);
1 like

Please or to participate in this conversation.