Support » Plugins and Hacks » exe files break unzip_file() function

exe files break unzip_file() function

  • Zambrano Sergio


    My plugin unzips my upload fine, but if there’s an .exe file inside it fails.
    Editing the content of the zip file in any way is not an option, since the sole purpose of the plugin is to avoid the user having to manually deal with the files.

    I used the function below to add .exe to the mime types with no success at first, but moving the function outside my plugin’s class gets exe added, in get_allowed_mime_types().

    function custom_upload_mimes ( $existing_mimes = array() ) {
    	$existing_mimes['exe'] = 'application/exe';
    	return $existing_mimes;
    add_filter( 'upload_mimes', 'custom_upload_mimes');

    After exe was added to the mimes it still won’t work.
    Archives without a .exe file unzip fine, though.

    I’d appreciate your advice on possible reasons for unzip_file() function not working.


  • The topic ‘exe files break unzip_file() function’ is closed to new replies.