Support » Plugin: WordPress File Upload » Custom whitelist for extensions

  • Resolved lgkatbsw


    The function wfu_file_extension_whitelisted($filename) uses a hardcoded array of whitelisted extensions. I would like to extend it with some more extensions.
    Is this possible with the Pro version? Otherwise, this might be a useful feature.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author nickboss


    Hi, it is actually very easy to add or remove extensions from the black list. Here is the code:

    global $wfu_extension_blacklist;
    //removal of html extension from blacklist
    if ( isset($wfu_extension_blacklist["html"]) ) unset($wfu_extension_blacklist["html"]);
    //addition of zip extension in blacklist
    if ( !isset($wfu_extension_blacklist["zip"]) ) $wfu_extension_blacklist["zip"] = 1;

    You can put it in functions.php file of your theme.



    Thanks for your reply. 🙂
    My goal is to allow ZIP file uploads, so I had to add it to the white list. Right now I can only do it by editing the wfu_security.php file of your plugin.
    It would be nice if you would handle $whitelist like global $wfu_extension_blacklist, so I can add items to it from outside.

    Plugin Author nickboss


    The shortcode has a visual editor (instructions). If you open it you will see option Allowed File Extensions. By default it is set to *.*. This will allow most common file types (images, videos, documents) but not zip files.

    If you want to allow also zip files, you can set it like this: *.*, *.zip

    There is no need to change blacklist array.



    Ahh, thank you very much. ^^
    That was the solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom whitelist for extensions’ is closed to new replies.