Uploading unpermmited filetypes for virtual products on woocommerce

I would like to sell an eBook on my website. I’m using WordPress and the shop uses woo commerce, which I just switched over to.
The problem is, the eBook comes in a folder, which is not so simple to upload and sell. If I upload an .exe file, I get the message “Sorry, this file type is not permitted for security reasons” and there are certain files in the eBook folder which generate the same error.

I can use WinRAR or similar to compress it and then upload it that way, but I can’t assume my users will have the technical ability to know what to do with it once downloaded.

Read More

The alternatives I came up with:
I have an install (.exe) file which is easy to download and use – it simply extracts everything and leaves shortcuts.
Ideally I would like to upload the entire folder and have the user be able to download the whole thing at once but, even if I could upload it, it doesn’t seem possible to select an entire folder but only individual files – I would be really grateful if someone knew of a way to do this!

I’m yet to find a workable solution so any help would be much appreciated.

Edit: Should have added this is for interactive eBooks, not a simple pdf, unfortunately.

Related posts

Leave a Reply

1 comment

  1. You are hitting WordPress’ internal restrictions on file / mime types for adding anything to their Media Library.

    This plugin should allow you to add .exe as a valid mime type.

    https://wordpress.org/plugins/enhanced-media-library/

    More details from the WordPress forum:

    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.