WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 4 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:
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 (2)

#1 @desrosj
17 months ago

  • Component changed from General to Upload

#2 @bobbingwide
4 months ago

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()

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

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

Note: See TracTickets for help on using tickets.