Opened 6 years ago
Last modified 15 months ago
#46775 new enhancement
Cannot allow multiple MIME for same file extension
Reported by: | thedanhealy | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 5.1 |
Component: | Upload | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Using 5.1.1, .zip are being detected as application/zip on my PC, but the same file (exact same) is being detected as application/x-zip-compressed on another PC. I've attempted to DISABLE_UNFILTERED_UPLOADS and temporarily removed the is_super_admin constraint from wp-includes/functions.php but still no luck. I also wasn't able to add this as an array without throwing a PHP exception.
This prevents me from allowing users to upload .zip from their PC. It's not appropriate for me to ask the user to make any changes to their PC.
Any advice?
Change History (3)
#3
@
15 months ago
- Keywords needs-patch added
I am often having this problem with SVG, because some of them are svg and some are svg+xml, so, I need to open it and strip XML first to be able to upload the file (it easier than to add xml to where it not exists). Probably other formats have this +xml
addition too.
Having debugged a problem with the File block ( https://github.com/WordPress/gutenberg/issues/23510 ) I searched and found the same issue as reported here.
My workaround was to use a different prefix for the mime type that some Windows browsers see.
I added the following line in wp_get_mime_types()
This resolved the problem for the File block.
The change does not seems to affect media upload.