Support » Fixing WordPress » Sorry, this file type is not permitted for security reasons

  • Resolved steffenharris

    (@steffenharris)


    Since the 4.7.1 update I am no longer able to upload podcast files without getting this error. Nothing changed about how we save our audio files. The files are consistently between 5-15 Mb each. I’m able to upload images (jpg, png are ones I tested), PDF files, but audio files, it won’t work.

    I’m logged in as the admin, again, nothing has changed with my workflow and how I do things, but now I’m getting this error.

    I’ve googled this issue and none of the troubleshooting I have found are relevant to this version of wordpress.

Viewing 15 replies - 16 through 30 (of 31 total)
  • Thanks Steve. The plugin didn’t work though for an ogv video file. Had to use the define fix, then removed it after successful upload.

    • This reply was modified 2 years, 7 months ago by  jaydenl. Reason: ogg to ogv typo

    This is still an issue in 4.7.3

    I’m on 4.7.3 and can no longer upload epub files.

    I had previously got this to work by adding this to my functions.php file:

    
    //* Add more mime types (in this case epub and mobi, but just add |file_extension|and_another to add more)
    function addUploadMimes($mimes) {
        $mimes = array_merge($mimes, array(
            'epub|mobi|webp' => 'application/octet-stream'
        ));
        return $mimes;
    }
    add_filter('upload_mimes', 'addUploadMimes');
    

    This worked great, but after a recent upgrade (I guess to 4.7.1) uploading epub files stopped working (mobi still works though, didn’t test webp).

    Installed the Disable Real MIME Check fixed the issue for me.

    Still happens in 4.7.4 with mp3 files that contain embedded png images for podcast artwork. Still have to use the disable real mime check plugin technique to be able to upload them.

    On wp-config.php

    define(‘ALLOW_UNFILTERED_UPLOADS’, true);

    Try this

    I am having this issue with MP3 files running WordPress 4.8 multisite.

    Installing and activating “Disable Real MIME Check” is allowing me uploads at present.

    From my host:
    “The WordPress used is 4.8. I am not sure if the upload bugs still exist in this version. I have checked the server logs and no configuration errors are being shown. The security error is trigger within the WordPress itself. The Midphase server configurations are correct. Some setting or development in the WordPress is preventing the larger MP3 file from being uploaded.”

    Problem is still present in v4.8 : refuses uploading of audio/* files

    There’s a new issue tracker ticket for this:
    https://core.trac.wordpress.org/ticket/40175

    I just added the WP Add Mime Types plugin. Fixed it up.

    I’m on HostGator, too. 🙂

    Heya – Also still seeing this on WP 4.8 for .ogg and .ogv files.

    The below code *will not* allow ogv files to be uploaded

    add_action('upload_mimes', 'allow_ogv_mime');
    function allow_ogv_mime($mimes = array()) {
    
            // Add a key and value for the CSV file type
            $mimes['ogv'] = "video/ogg"; // video/ogg
            $mimes['ogg'] = "audio/ogg"; // audio/ogg
    
            return $mimes;
    }
    

    Had to temporarily enable ALLOW_UNFILTERED_UPLOADS to upload the file.

    Thanks

    • This reply was modified 2 years, 3 months ago by  mclaurent.
    • This reply was modified 2 years, 3 months ago by  mclaurent.
    GayFord

    (@gayford)

    I’m having this problem on one of my sites but not on the other. Same host, same WP, same everything. But it doesn’t allow ANY video file types…says they’re all prohibited due to security reasons.

    pingram

    (@pingram3541)

    Well this is cluster-you-what…any light ahead on this? Maybe 5.0?

    Can’t upload OGV either – despite defining the MIME type in functions.php
    “This filetype is not permitted for security reasons” or something like that.

    Neither the first, nor the second code block worked:

    add_filter( ‘upload_mimes’, ‘my_myme_types’, 1, 1 );
    function my_myme_types( $mime_types ) {
    $mime_types[‘ogv’] = ‘video/ogg’; // Adding .ogv extension
    return $mime_types;
    }

    add_filter( ‘upload_mimes’, ‘my_myme_types’, 1, 1 );
    function my_myme_types( $mime_types ) {
    $mime_types[‘ogv’] = ‘video/ogg’; // Adding .ogv extension
    return $mime_types;
    }

    • This reply was modified 1 year, 11 months ago by  pressworthammer. Reason: Tags

    Can confirm this issue still persists on WP v4.9.1 with ogv files despite being listed as a file that’s supported.

    Having this problem today, with everything uploaded/installed and upgraded as per all the posts above.

    This is maddening.

    Oh, for me it’s happening on PDF’s. Why is this particular ticket marked resolved?

    I confirm that this issue does exist (as of WordPress 4.9.1) and does not allow me to upload some files even with the ‘define’ fix.

    However, there is a workaround (not sure if someone already wrote about it): the browser uploader (not a wordpress built-in one) allows me to upload necessary file though I have to do it file-wise.

    Agree, @matches-malone. This should not be marked as resolved.

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Sorry, this file type is not permitted for security reasons’ is closed to new replies.