• The Download_Type selector no longer appears when adding a file to a downloadable variation. This makes it impossible to make a downloadable variation to download a software installation program (.exe file extension).

    The DOWNLOAD_TYPE selector does appear on SIMPLE PRODUCTs and can be set to Application/Software, but when you attempt to update the Product page, you the following error…

    The downloadable file ATV_Tr_NH.exe cannot be used as it does not have an allowed file type. Allowed types include: jpg|jpeg|jpe, gif, png, bmp, tiff|tif, ico, asf|asx, wmv, wmx, wm, avi, divx, flv, mov|qt, mpeg|mpg|mpe, mp4|m4v, ogv, webm, mkv, 3gp|3gpp, 3g2|3gp2, txt|asc|c|cc|h|srt, csv, tsv, ics, rtx, css, htm|html, vtt, dfxp, mp3|m4a|m4b, ra|ram, wav, ogg|oga, mid|midi, wma, wax, mka, rtf, js, pdf, class, tar, zip, gz|gzip, rar, 7z, psd, xcf, doc, pot|pps|ppt, wri, xla|xls|xlt|xlw, mdb, mpp, docx, docm, dotx, dotm, xlsx, xlsm, xlsb, xltx, xltm, xlam, pptx, pptm, ppsx, ppsm, potx, potm, ppam, sldx, sldm, onetoc|onetoc2|onetmp|onepkg, oxps, xps, odt, odp, ods, odg, odc, odb, odf, wp|wpd, key, numbers, pages

    An .exe file type is recognized as a Windows Program in schema.org list, but filtered out by Woocommerce?

    https://wordpress.org/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Matt

    (@theboytangent)

    I have this same issue with m4r (Apple Ringtone) files.

    Thread Starter Rick.Ryen

    (@rickryen)

    Another side effect when you get the error is that it clears the download name and file boxes. So even a simple typing error requires you to type it all back in again.

    Same issue here. The Woocommerce update just wiped out all my products (.epub and .mobi files for ebooks).

    A work around is to stick them in a zip folder because it accepts zip files, but that’s going to be absolutely useless for ebooks because an epub is a kind of zip file, so it’d be like selling someone a zip inside a zip (insert unhappy customers here).

    I hope this gets fixed soon. My store is offline because of it.

    The only place I can find access to file types is in the .htaccess, but the code there doesn’t look like the same string as the error message, so I’ve left it alone.

    If anyone has a fix for this, I’d be eternally grateful.

    *Edit: Until a fix for this appears, don’t update your products. It’ll save you updating everything when it’s fixed.

    I found that the products I haven’t changed since the update are still working. So it’s only happening on new products or products I’ve saved recently.

    Hi
    Well i have this problem also but i’m uploading files as zip and still get that error i also did try to upload jpeg, psd, text files… for everything i try to add I get that error…

    What happen with this can someone help fix this

    checking in with same issue.

    using .rar files.

    @kireaki
    I had to download and install the previous version: https://wordpress.org/plugins/woocommerce/developers/

    @schoelje

    Thanks dude, I think I’ll do the same.

    oh, ty @schoelje i will do it right now

    Edit: Downloaded and install 2.3.9 version and it’s working fine

    Still i hope they will fix it in next update

    Hi guys,

    The users of my plugin Woocommerce-Dropbox are all facing this issue, because of the need to add a query string to the download URL. Is it possible to filter this behaviour or maybe disable this functionality untill this trac issue has been resolved?

    I imagine a lot of users are facing this problem right now.

    Thanks

    Hello, same problem here.
    I wonder why they have added such a useless feature, with critical effect now…

    What’s the point to limit downloads by type? Limiting compromised servers serving malware?

    Yes, don’t update products, that happens only when you hit the “Update” button.

    Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    The underlying WordPress function called get_allowed_mime_types is used which is filterable and can be customized based on your needs via the WordPress provided filter named upload_mimes which is documented here: https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes

    Thanks, WilltheWebMechanic. Your post helped me fix the issue without reverting to an older version of Woocommerce.

    If anyone else is wary of the functions.php file like I am, you can use a plugin for it.

    This is the one I used, and it seems nice and stable. Plus, it’s compatible with Woocommerce, which is why I chose it: https://wordpress.org/plugins/enhanced-media-library/

    Once it’s installed, you can just add your file type to the ‘Mime’ section of the plugin.

    I just added the file types I needed (epub and mobi). I hit save and my products are all working again.

    Beware of changing the allowed mimetypes if you have any plugins or functionality allowing users to upload files through WordPress such as bbPress attachments or any sort of customer support ticketing system or image gallery. You will be allowing it there as well.

    I would recommend making sure the user is able to manage woocommerce before adding the mimetypes. You can do that with the following, replacing exe/dmg with whatever files you need to allow:

    // Allow exe or dmg for digital downloads
    add_filter('upload_mimes', function($mimetypes, $user)
    {
        // Only allow these mimetypes for admins or shop managers
        $manager = $user ? user_can($user, 'manage_woocommerce') : current_user_can('manage_woocommerce');
    
        if ($manager)
        {
            $mimetypes = array_merge($mimetypes, [
                'exe' => 'application/octet-stream',
                'dmg' => 'application/octet-stream'
            ]);
        }
    
        return $mimetypes;
    }, 10, 2);

    Also of note the ability to use protocol relative URLs is broken with the check added in 2.3.10 so you must explicitly put http:// or https:// rather than // for your download links.

    Hi Einkoro,

    Thanks for your code. This new version of Woocommerce is causing me huge problems for my site of 300+ variable products. All my content is epub, prc and mobi eBooks. I appreciate your helpful code, but when adding it, I then get a further error message when trying to update a product page’s download link:

    The downloadable file [filename] cannot be used as it does not exist on the server.

    I have also tried MIME plugins etc, but these messages still come up. It seems Woocommerce will not allow me to add links to these file types any more, though I have been selling them for years and the files are correctly located on the server. Any ideas how I can get this sorted?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘2.3.10 Download File_Type missing in variations, filters .exe’ is closed to new replies.