• Suddenly today I started getting error messages “Sorry, this file type is not permitted for security reasons.” from one minute to the next. I have looked through the forums but don’t understand this sudden problem.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Have you checked with your host? Those “suddenly” problems often come from changes the host makes.

    Thread Starter mister_russ

    (@mister_russ)

    OK, will do that. I agree its suspicious.

    But yesterday the first problem that I had was with a swf file and I found a workaround on the forum for that.
    I was less shocked to read that a swf poses a security threat than I was later in the dya to learn that even jpgs and pngs are dangerous…!

    I’ve tried uploading both from a post and direct to the Media Library.
    The error messages do appear to be coming from WordPress – if it was a server problem I would expect a different reaction.
    I’ve also installed the AP Extended MIME Types plug in that someone recommended in a forum but that has made absolutely no difference.

    Thread Starter mister_russ

    (@mister_russ)

    OK will do that – I agree that it is suspicious.

    Yesterday my first problem was with an swf file and I found a workaround in a forum.
    But jpg and png surely don’t pose a security threat?

    I’ve tried uploading both from a post and directly to the Media Library always with the same result. The error messages do look more like they come from WordPress than my host so I would be surprised if this is the issue…any other suggestions ?

    Thanks !

    Thread Starter mister_russ

    (@mister_russ)

    So I just tried and I have no problem uploading all types of image files to another WordPress site on the same server.

    However, I do have over 2,600 images of various sizes in the Media Library which is now refusing uploads – could it be that I’ve hit some form of limit within WordPress ?
    If so, how can I fix it ?

    (At Hostgator I have unlimited capacity)

    Thanks !

    WordPress has no limit on images.

    Are you running wp multi-site?

    If not a couple of things to try.
    Add to wp-config.php
    define('ALLOW_UNFILTERED_UPLOADS', true);

    or to .htaccess add
    AddType image/jpeg .jpg
    AddType image/png .png

    This still does not tell us why you are having the problem. The normal debug is to disable all plugins and switch to the default theme. You should try that before making changes.

    Thread Starter mister_russ

    (@mister_russ)

    Thanks – no not on multi site.
    I tried both of these but only managed to create error messages and blocking my site – I guess I put them in the wrong places…

    Now that I work my way back through the problem, it all started just after I upgraded to version 3.7.1 when I suddenly could no longer upload swf files. I found this workaround on the WP forum but it inadvertently blocked other images files:

    In the TwentyTen theme:

    function demo($mimes) {
    if ( function_exists( ‘current_user_can’ ) )
    $unfiltered = $user ? user_can( $user, ‘unfiltered_html’ ) : current_user_can( ‘unfiltered_html’ );
    if ( !empty( $unfiltered ) ) {
    $mimes = array(
    ‘swf’ => ‘application/x-shockwave-flash’,
    ‘exe’ => ‘application/x-msdownload’,
    );
    }
    return $mimes;
    }

    add_filter(‘upload_mimes’,’demo’);

    I seems that was now allowing swf but blocking all other image files.

    The workaround was to extend the list of permitted files by adding to the above:

    ‘png’ => ‘image/png’,
    ‘gif’ => ‘image/gif’,
    ‘jpeg’ => ‘image/jpeg’,
    ‘jpg’ => ‘image/jpeg’,

    The other WP site that I have and that I checked runs on WP 3.5 and has absolutely no issues…

    If I delete the workaround, I can indeed upload png jpg etc, but not swf, so I conclude that there is some bug in 3.7.1 that prevents uploading swf files. WP may wish to look into this …?

    Meanwhile, I will carry on as is now – “if it works, don’t fix it!”

    Thanks for your help !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cant upload jpg or png files’ is closed to new replies.