WordPress.org

Ready to get started?Download WordPress

Forums

exe files break unzip_file() function (1 post)

  1. Zambrano Sergio
    Member
    Posted 2 years ago #

    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.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Zambrano Sergio
  • This topic is not resolved
  • WordPress version: 3.2.1