10up / windows-azure-storage

Use the Microsoft Azure Storage service to host your website's media files.
https://wordpress.org/plugins/windows-azure-storage/
BSD 2-Clause "Simplified" License
62 stars 46 forks source link

Incorrect Content-Type being applied to uploaded files in v 4.4.0 #210

Closed okadots closed 5 months ago

okadots commented 10 months ago

Describe the bug

When uploading files via the WP admin, the Content Type is being incorrectly applied in Azure. All files, regardless of file type, are being uploaded to Azure with the content type of application/octet-stream.

In WordPress, the attachment details show the correct content type.

This is causing PDFs to automatically download vs open in the browser. This is the case for all uploaded media files as well.

Changing the content type via the Azure interface resolves the behavior issue, but manually resolving for every file uploaded to a multiuser multisite is not a reasonable workflow.

Downgrading to v 4.3.5 fixes the issue and the correct content type is applied.

Steps to Reproduce

  1. Upload a file of any kind via WP admin
  2. In the attachment details, copy the file url and paste in browser. File will download instead of being viewed in the browser.
  3. To test file type, curl -v the file url and see that content type is: Content-Type: application/octet-stream

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

Microsoft Azure Storage for WordPress v4.4.0 WordPress v6.3.1, this is a multisite php v8.2 mysql v8

Code of Conduct

sarahannnicholson commented 10 months ago

Can I just add, that this is happening for .svg files as well.

Microsoft Azure Storage for WordPress v4.4.0 Wordpress version: v6.4.1

nicoladj77 commented 9 months ago

Bug confirmed for me too, with PDF uploads on v4.4.0

hugosolar commented 5 months ago

This should be fixed with this PR: #224