• Hello, I want to allow all file types to be uploaded to my website; Its a multivendor digital marketplace and it isn’t very convenient for sellers when they can only upload .zip files when making downloadable products (which are the only ones wordpress allows).
    I’ve tried to use some plugins for that, but none really helped.

    • This topic was modified 4 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator threadi

    (@threadi)

    You have 3 possibilities:

    Add the following to your wp-config.php
    define('ALLOW_UNFILTERED_UPLOADS', true);
    This would actually allow all file types. Please note that this could be a potential risk for your server and your visitors as you would have no control over what is uploaded there.

    Or add the file types you want in the functions.php or a plugin you wrote yourself:

    add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
    function my_myme_types( $mime_types ) {
      $mime_types['svg'] = 'image/svg+xml'; // Adding .svg extension
      return $mime_types;
    }

    Or use a plugin where you can select and specify in wp-admin which file types should be allowed: https://ww.wp.xz.cn/plugins/file-upload-types/

    Thread Starter nictfk

    (@nictfk)

    The first option of modifying wp-config didn’t work, I’ll look into it though, probably an error on my end.
    I tried the plugin you suggested too before, the thing is, some of the file types my vendors want to upload are not listed there, and simply adding in the code for those also didn’t work (once again I do it incorrectly probably)
    But anyways, thanks for the help, if there isn’t anything else you can suggest me in this case, I’ll mark this topic as resolved.

    Moderator threadi

    (@threadi)

    If you have problems with this plugin please ask their developers in their support-forum: https://ww.wp.xz.cn/support/plugin/file-upload-types/ – I use it on some projects without any problems.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress file uploader’ is closed to new replies.