Wordpress - Is it possible to allow zip files to be uploaded in Wordpress?
If you are using WP MultiSite you can configure the behavior the following way (tested in WP 3.8.1):
- Go to the network settings in your browser:
http://example.com/wp-admin/network/settings.php
- Scroll down to the bottom of the settings page and you will find a list of allowed file types, add
zip
to it.
Here is a action that works on my site:
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
// add your extension to the mimes array as below
$existing_mimes['zip'] = 'application/zip';
$existing_mimes['gz'] = 'application/x-gzip';
return $existing_mimes;
}
In 5.0.3 (probably already earlier): For multisite (at least), you can edit the allowed extensions and add zip in the network settings. No need to edit files anymore.
My Sites > Network Admin > Settings > Upload file types