Adding upload mimetype in Multisite does not work if mimetype is not already defined
|Reported by:||BjornW||Owned by:|
We would like to add 3gp to the list of file types to be uploaded in the sites of our network install.
We've tried to add 3gp to the Network Settings->Upload File Types setting for this. However after having saved the setting we were still not able to upload 3gp. It seems the user setting is being overruled by the list of global settings.
Steps to reproduce issue:
- Use WordPress Network install (aka Multisite)
- Add the file extension 3gp to the upload file types setting in Network Settings
- Save Settings
- Try to upload a 3gp file using the Media Library, it will fail with the message: 'Sorry, this file type is not permitted for security reasons.'
It seems the upload file types defined in the Network Settings cannot overrule / add new file types if this file type has not already been defined in the function wp_get_mime_types() (see file: wp-includes/functions.php).
Changing the Upload File Types by adding a new extension results in WordPress accepting files ending in this extension. Or warn the admin that this extension is unknown and more info (such as the full mime type) is needed.
We are aware of the hook 'upload_mimes' to fix this with a plugin, but we suggest that the superadmin Network Settings->upload file type overrules WordPress' built-in defaults instead of the other way around.
Change History (24)
comment:16 @mbijon — 2 years ago
- Cc mike@… added
comment:19 follow-up: ↓ 20 @helenyhou — 2 years ago
comment:22 @jeremyfelt — 16 months ago
- Component changed from Multisite to Upload
- Focuses multisite added