HTTP error when uploading an image via the WordPress Media Uploader

Each time I try to upload an image using the WordPress Media Uploader (WP Admin > Media > Add new) the upload stalls at around 13% and I get an error message appear on screen "HTTP error".

So far I have created a php.ini file in my WordPress root with the following:

Read More
memory_limit = 256M
upload_max_filesize = 16M
post_max_size = 64M

I’ve also put a php.ini file in my /wp-admin/ folder (an exact duplicate of the above).

After checking with phpinfo() I can see these changes have taken effect but they have not resolved the ‘HTTP error’ problem I am getting.

I am using a 1and1.co.uk dedicated server (managed) so don’t have root access. 1and1 have confirmed plain CGI is enabled on the server (not Fast CGI if that makes much difference?).

Why might this error be happening? Is there anything else I can do to try to resolve it?

UPDATE: I have done some testing using different browsers and different devices:

Acer Aspire One netbook

  • Chrome – problem exists
  • FireFox – problem exists
  • IE – working
  • Safari – problem exists

Acer Aspire 5552 laptop

  • Chrome – working
  • FireFox – working
  • IE – working
  • Safari – working

Google Nexus 7 tablet

  • Chrome – working
  • FireFox – working
  • IE – working
  • Safari – working

Samsung Galaxy G4 Mini

  • Chrome – working
  • FireFox – working
  • IE – working
  • Safari – working

As you can see the problem only exists in Chrome, FF and Safari on my Acer Aspire One netbook. What could be the source of this problem?

Related posts

Leave a Reply

12 comments

  1. I put the following code into my functions.php file. It works!

    add_filter( 'wp_image_editors', 'change_graphic_lib' );
    function change_graphic_lib($array) {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }
    
  2. I have often had problems with the (IMHO) very finicky media uploader of WordPress. And almost without fail, they are jpegs. And I can almost always solve the problem by opening them in Photoshop and using the “Save for web…” command which, among other things, removes embedded icon previews and performs other optimizations. For some reason, that almost always works for me. Which leads me to believe that there is something in the files themselves that WordPress is choking on, not always related to size (although that can sometimes be a problem).

  3. Put below code in your activated theme’s functions.php file.

    If your media uploader gives HTTP error while uploading image, Try to change graphic library using below filter.

    Below filter used for change the graphic library.

    I hope it’s help you.

    add_filter( 'wp_image_editors', 'change_graphic_lib' );
    
    function change_graphic_lib($array) {
        return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }
    
  4. Try a smaller image – both file size and display size – and see if you can upload it.

    mod_security might be causing problems. Disable it to see if that is the problem.

    Make an .htaccess file in your wp-admin directory. Add this to it:

    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>
    
  5. It’s a browser issue. WordPress media uploader uses JavaScript and it seems that some of the browsers you tested don’t work well with such uploader.

    You always have a link on add new media page to a non-javascript upload. Test that and see if the problem persists.

    Updated

    We commented my first idea, and it isn’t a browser issue.

    So, if it’s something related to the backend, I guess you should start checking type and size of images. Access to server logs should help you a lot.

    Using Apache, directive MaxRequestLen is always an important factor. Did you check that?

  6. I use the Hiawatha web server, and in my case, the issue was MaxRequestSize and MaxUploadSize values being set too small.

    I’ve solved it by adding this to my /etc/hiawatha/hiawatha.conf:

    Binding {
            Port = 80
            MaxRequestSize = 1000000
            MaxUploadSize = 550
    }
    Binding {
            Port = 443
            SSLcertFile = /etc/hiawatha/serverkey.pem
            MaxRequestSize = 1000000
            MaxUploadSize = 550
    }
    
  7. it easy to fix. just click right button in picture, properties and than unblock picture, its on the bottom. that will work. I tried all other thinks from forums and nothing. works on windows 10

  8. I had an issue where any files over 100k were failing. The following worked for me:

    Add the following line to fcgid.conf:

    FcgidMaxRequestLen 52428800

  9. Put this is your themes function.php It’s Working.

    add_filter( 'wp_image_editors', 'change_graphic_lib' );
    
    function change_graphic_lib($array) {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }
    
  10. You might want to try this: Upload the big images (using FTP or CPanel) to wordpress folder/wp-content/uploads/2013 or something like this.

    Then try to add these images to your wordpress site (post featured image/product image or others). You’ll find the images at the left side under “uploaded images or all images”.

  11. Try to edit link. in my case, it solve with changing name. Initially it is “webpic’1_1.jpg” and i removed ” ‘ ” and changed to “webpic1_1.jpg”. It worked !…