WordPress Plugin: Image Upload HTTP Error Fix

This plugin is no longer maintained and should no longer be used.

Description

Fixes the media uploader HTTP Error that some WordPress configurations suffer from.

If your WordPress 2.5 installation shows an HTTP Error when uploading files using the media uploader, then this plugin should fix that problem. Simply upload and activate the plugin, then you’ll be able to upload files with no problem.

Technical details:

The plugin adds a few lines to WordPress’ .htaccess file which deactivates mod_security on the file which handles file uploads.

Installation

  1. Unzip the ZIP file and drop the folder straight into your wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. That’s it! Try uploading a file with the media uploader and the HTTP error should be gone.

Download

ZIP file from downloads.wordpress.org

Any comments, questions, queries, suggestions, complaints, etc, please leave a comment!

66 thoughts on “WordPress Plugin: Image Upload HTTP Error Fix

  1. AskApache

    Very sweet to have a 2 line plugin like that. just wanted to let you know I was inspired upon seeing the code! I’m going to start doing things that way when dealing with root .htaccess from now on.

  2. Drunkbunny

    Worked like a dream! This error was really a pain in my butt. By fixing it you have improved my quality of life.

  3. Keith

    I’d like to install this plugin but when I read stuff like “deactivates mod_security” I wonder if it’s going to make my WordPress installation less secure. Will it?

  4. John Blackbourn Post author

    Keith, it only deactivates mod_security for one file – async-upload.php – so the reduction in security is negligable. That said, use the plugin at your own risk! :)

  5. xtoto

    (IfModule mod_security.c)
    (Files async-upload.php)
    SecFilterEngine Off
    SecFilterScanPOST Off
    (Files)
    (IfModule)

    (IfModule security2_module)
    (Files async-upload.php)
    SecFilterEngine Off
    SecFilterScanPOST Off
    (Files)
    (IfModule)

  6. teknoloji

    when i create a writer account, it gets http error

    you gave the solution, thanks.

  7. Constance

    I would like to thank you for this plugin! It really made my day. I shared your plugin in my blog, linked to this site.

  8. Marcus

    I have installed this plugin but still have problems on my MacBook with Firefox. On my PC with Firefox it work well.

  9. Ian Romaine

    Thank you for this! My blog has only been set up in the last couple of days but this problem has been driving me crazy for the last 48 hours… a brilliant plugin.

  10. Jon Ford

    Plugin is still not working. I’ve installed WP on a subdomain. Could that be the issue?

  11. John Blackbourn Post author

    Jon: That shouldn’t affect this plugin. Can you check your blog’s .htaccess file and make sure that the additional information added by this plugin is in there? It will be surrounded by #BEGIN HTTP ERROR FIX and #END HTTP ERROR FIX.

  12. Jon Ford

    It is not there. It just says #BEGIN WORDPRESS and #END WORDPRESS. Can I force it or manually paste the code correctly into the file? I tried a couple of options and failed.

  13. Jon Ford

    It didn’t work, but I did find a way to manually paste the code into the .htaccess file. Thanks for the the great work and attention to my bizarre little situation.

  14. Wesley

    OK! Fixed

    Just added this text into my .htaccess :

    SecFilterEngine Off
    SecFilterScanPOST Off

  15. Jeff

    My webhost just upgraded to Apache2 and this plugin causes a fatal server error when activated. Is anyone having success with this working on Apache2?

    Prior to the webhost upgrade this plugin worked fine.

    Thank You

  16. Darryl

    The plugin is not workng for me, and I don’t see where in ‘Permalinks’ to update your .htaccess file Please help

  17. John Blackbourn Post author

    Jeff:
    Somebody else has reported a 500 Server Error with this plugin. Can you check your .htaccess file and make sure that no lines in the file have a comment halfway along? For example there is an outside chance that WordPress puts “# BEGIN WORDPRESS” on the end of an existing line in the file instead of on a new line.

    Darryl:
    Go to the Settings->Permalinks page and make sure one of the permalink options are selected. Hit the ‘save’ button at the bottom. If WordPress cannot update your .htaccess file itself it will provide you with a link telling you how to do it.

  18. Romeo Choueiry

    Hey and thanks for this wonderful plugin..

    However it’s not working for me.. Only .htaccess i got is the one i got for my website, root folder.. nothing in wp folder.. So my question is, what am i supposed todo to fix it? And if i have to update it mabnually, what do i need to put in? :D

  19. John Blackbourn Post author

    Romeo: First try going to your Settings -> Permalinks page, hitting the Save button, then trying to upload something again. If that doesn’t work, then the .htaccess code can be found here and you can add it manually.

  20. Wendy Friedrich

    After uploading to Cpanel still get this

    Unable to create directory /home/wenfri/public_html/wordpress/wp-content/uploads/2008/07. Is its parent directory writable by the server?

    Edited permissions to 755 and already have an updated .htaccess code

    Now what???

  21. hyperclicks

    followed the instructions and i’m still getting the error. went to the settings > permalinks and chose a few options and still it doesnt solve the html error. help please?

  22. mongushu

    I tried every stinking fix for the 2.5 uploader with no success. Then I found your plugin. IT WORKS PERFECTLY!!!!! Thank you so much!

  23. xtoto

    Only now met in this comment _http://wordpress.org/support/topic/180235%23post-789802_

    seems to me that you do not understand ..

    in security2_module not include SecFilterEngine On both actual and disable Off as it is not this function … The default module is configured correctly and in general there is nothing to change, perhaps that is why developers and disabled SecFilter, two commentaries about it earlier and I asked you, but unfortunately you have read only the second since the first apparently ate akismet .. :) In it, I described in more detail the crux of the problem ..

    —– NOT QUALIFIED ——
    IfModule security2_module
    SecFilterEngine Off
    SecFilterScanPOST Off
    IfModule
    —– NOT QUALIFIED ——

    —– NOT QUALIFIED ——
    BEGIN Image Upload HTTP Error Fix
    IfModule mod_security
    Files async-upload.php
    SecFilterEngine Off
    SecFilterScanPOST Off
    Files
    IfModule
    IfModule security_module
    Files async-upload.php
    SecFilterEngine Off
    SecFilterScanPOST Off
    Files
    IfModule
    IfModule security2_module
    Files async-upload.php
    SecFilterEngine Off
    SecFilterScanPOST Off
    Files
    IfModule
    END Image Upload HTTP Error Fix
    —– NOT QUALIFIED ——

    —– QUALIFIED ——
    BEGIN Image Upload HTTP Error Fix
    IfModule mod_security.c
    Files async-upload.php
    SecFilterEngine Off
    SecFilterScanPOST Off
    Files
    IfModule
    END Image Upload HTTP Error Fix
    —– QUALIFIED ——

    for each module security must be separately (NOT TOGETHER !!!!)

    —– QUALIFIED ——
    BEGIN Image Upload HTTP Error Fix
    Files async-upload.php
    SecRuleEngine Off
    Files
    END Image Upload HTTP Error Fix
    —– QUALIFIED ——

  24. LDaly

    thanks very much. I spent alot of time trying to figure out this error. With your plugin, you’ve really helped me out!

  25. John Blackbourn Post author

    xtoto: Thanks again for your feedback! I’ll take a look at make some improvements to the plugin to try and cover as many scenarios as possible.

  26. Albanah

    Dear John Blackbourn,

    I am suffering from the HTTP Error during download.
    I do not have the htaccess file.
    Please send it to me and help me where to put.
    I have added the plugin but problem still exists.
    I have done every thing above but without success.

  27. Michael

    I run 8 different blogs all using version 2.5.1. They were all upgraded to that version from the same basic WP file so are as identical as I can make them (excluding themes, favicons, etc). I recently started upgrading them all to 2.6 and ran into the HTTP Error when uploading photos. I had earlier fixed that problem on 2.5/2.5.1 by creating my own .htaccess file, but thought this time I would try your plug-in. Your 1.1 plug-in worked great on the first site. Then on the 2nd, it didn’t fix the problem so I changed the permalink from default and saved it. That fixed the problem on sites 2, 3, 4 and 5.

    The problem I’m now having is now on site 5 when I click on the headline of a post and send it to the single page, after showing the post for a few seconds it disappears and tells me “Sorry, no posts matched your criteria”. By switching the permalinks back to default that problem goes away but the HTTP Error is back because the plug-in by itself isn’t working.

    I deactivated your plug-in and uploaded my old .htaccess file and it fixed the HTTP Error problem.

    SecFilterEngine Off
    SecFilterScanPOST Off

    Got any ideas on this new wrinkle?

    Thanks,

    Michael

  28. John Blackbourn Post author

    Michael,

    Thanks for commenting. What a strange error. Can you try disabling all your other plugins except Image Upload HTTP Error Fix and see if the problem still persists? If the page disappears a few moments after first being displayed, it sounds like another plugin (possibly a plugin with some form of AJAX in it) is getting in the way.

    Another thing to try is to re-activate the pretty permalinks, copy the code that my plugin inserts into the .htaccess file, deactivate the pretty permalinks, and then paste the code back into the .htaccess file and see if that solves the problem.

  29. Michael

    Thanks John, your reply got me thinking about whether this error is even caused by plug-ins or not. I deactivated all the plug-ins and the error still happened, so I put the permalinks back to default, turned on all the plug-ins and the image upload works great. So it looks like I’m going to have to dig deeper, probably into the theme. I’m not surprised with that result as this is the one site of all 8 that I have the most problems with. Guess it’s time to rebuild it.

    Michael

  30. John Blackbourn Post author

    v3rona: If you’re happy editing your blog’s .htaccess file, try adding this to the end of the file:

    <IfModule mod_security.c>
    <Files upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    NextGen uses a file called upload.php for handling uploads, and this code should disable mod_security on that file. It’s untested, so let me know how it goes.

  31. Matt

    Please help! I started getting the 500 Internal Service error this afternoon. HOstgator suggested to remove the plug-in and wipe my htaccess file. Now none of my images are loading and clicking on a story gives you a 400 error. Im not sure what has happened but I have no clue how to go about fixing this.

  32. sean

    I am trying to use the plug-in, but I don’t have an .httaccess file. Is there a standard one I can use that won’t conflict with the type of password protection I have enabled at trafficalerts.biz?

  33. John Blackbourn Post author

    Sean:

    Once you’ve installed and activated the plugin, go to the Settings -> Permalinks menu in WordPress and click the ‘update’ button at the bottom without making any changes. WordPress should then generate a new .htaccess file for you.

    If it doesn’t, then simply create a blank text file on your computer called “htaccess.txt”, upload it to your server and then rename it to “.htaccess”.

    You may then need to resave your Permalink options following the first step above.

    Hope this helps,
    John.

  34. Exoskeletor

    hello. i have try the plugin and manually creating an security.htaccess file and puting it to the root and wp-admin folder but im still getting the http error. im usins 2.7.1 version
    I have alter the default theme manually after a lot of tries. is there a possibility to have made a mistake there? this is my wordpress http://www.bstefanou.gr/arthra if you want to see the default theme

  35. John Blackbourn Post author

    Exoskeletor: You might want to try an alternative fix here. If that doesn’t work then I can’t help you I’m afraid, as none of my blogs get the HTTP Error in WordPress 2.7+.

  36. Exoskeletor

    i have rename my htaccess file to .htaccess file and i was getting an internal error 500. i have delete this file and it was fixed but when i went again to permalinks and try to hit save the error has come again and i wasnt able to see any htaccess files. i try to upload my local files but this didnt help (maybe because my local files has the original files of 2.7.1 before the database update etc?) how much i have destroy my blog? may i delete the folder completely from my server and try uploading it again?

  37. John Blackbourn Post author

    Exoskeletor:

    * Delete your .htaccess file
    * Delete the ‘wp-content/plugins/http-error-fix’ folder
    * Go to the Permalinks screen and press ‘Save Changes’ and your permalinks should be restored and your blog should be visible again

  38. Exoskeletor

    i have upload all my files and i delete ur plugin and .htacess files but im still getting this error. am i doing something wrong? my backup was the new 2.7.1 files before the upgrade from 2.6 i have another backup from 2.6

  39. Exoskeletor

    when u change in permalinks in 2.7.1 the way posts are stored does it make any changes to the database? i cant understand why even the backuo isnt working

  40. Joe

    If this fix doesn’t work for you, try this:

    You may be running PHP 4 and turning on PHP 5 may fix it for you. Worked for me after I couldn’t get the plugin to fix things. Try adding this to your .htaccess file:

    AddType x-mapp-php5 .php

  41. JASPRIT

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, INFOr@MY SITE NAME.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 Server at http://www.MY SITE NAME.com Port 80

    please get out me from this

  42. John Blackbourn Post author

    Faisal: I’m afraid this plugin is no longer being maintained and may not work at all with WordPress 2.8. To clear the Internal Server Error, delete the plugin from your server, then open up your .htaccess file and delete the lines between #BEGIN HTTP ERROR FIX and #END HTTP ERROR FIX.

Comments are closed.