0

I'm struggling with this one and I'm not sure where the issue is.

When I upload a .docx and .pptx it's saved with a .zip extension on the file system instead with the mime type application/octet-stream.

I'm using Laravel Valet at the moment so any .htaccess edits won't work. I've had a look at the nginx mime.types and see both of the mime types for docx and pptx in there.

Does anyone have any ideas on how I can get the files to upload with the correct extension and mime type?

Cheers!

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
BarryWalsh
  • 1,300
  • 4
  • 14
  • 36

1 Answers1

0

Finally figured it out. Using the Storage facade and put lets me give a filename which will preserve the extension.

Storage::disk('s3')->put( $storage_file_name, file_get_contents($request->file) );
BarryWalsh
  • 1,300
  • 4
  • 14
  • 36