Make WordPress Core

Opened 5 years ago

Last modified 8 months ago

#46775 new enhancement

Cannot allow multiple MIME for same file extension

Reported by: thedanhealy's profile thedanhealy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.1
Component: Upload Keywords: needs-patch
Focuses: Cc:


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)

#1 @desrosj
5 years ago

  • Component changed from General to Upload

#2 @bobbingwide
4 years ago

Having debugged a problem with the File block ( ) 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()

'xzip'                           => 'application/x-zip-compressed',` 

This resolved the problem for the File block.
The change does not seems to affect media upload.

#3 @oglekler
8 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.

Note: See TracTickets for help on using tickets.