Support » Fixing WordPress » Unable to upload .otf file to media library due to “security reasons”.

  • Hi all,

    I’ve been unable to upload .otf files to Media Library with the following error: “Sorry, this file type is not permitted for security reasons.” I’ve searched the forums and this has been noted before with other file types. Most posts are from several months to years ago.

    What is the latest (and best way) around this?

    Ivan

    • This topic was modified 3 months, 1 week ago by Jan Dembowski.
    • This topic was modified 3 months, 1 week ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • You may have some luck in the plugins directory. Search on something similar to this: https://wordpress.org/plugins/search/file+types/

    What you are looking for is a plugin that will allow you to add file extensions to the default list of allowed file types.

    Very easy to fix if you have admin access.

    Add the following to functions.php in your theme’s folder:
    //* allow otf file upload to media library
    add_filter(‘upload_mimes’, ‘custom_upload_mimes’);
    function custom_upload_mimes ( $existing_mimes=array() ) {
    // add your extension to the array
    $existing_mimes[‘otf’] = ‘application/otf’;
    return $existing_mimes;
    }

    Works with any file type as long as you find the correct mime type.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.