WordPress Upload HTTP Error Fix
June 16th, 2009
Several versions of WordPress ago, I started sporadically encountering a problem while trying to use the Flash uploader in WordPress. Every time I tried to upload something using the Flash uploader, I would just get this HTTP Error message:
I searched for a solution to the problem and found that it was a bug in one of the older versions of WordPress. Now, several versions later, it’s still happening. I’ve seen it on both WordPress 2.7 and WordPress 2.8. More Googling revealed several tips about about adding directives to the .htaccess file. I tried each of them, but with no success.
The most puzzling part of this problem for me was that I have several different installations of WordPress on different servers and different versions, but this error was only happening on some of them. After I actually sat down and thought about the problem, I realized that the error was only occurring on the WordPress installations that I had set to be private through the authorization control using my .htaccess files. Those sites have an .htaccess file in the root directory which starts with something like this:
AuthName "private site"
AuthType Basic
AuthUserFile /home/private/.htpasswd
Require valid-user
This causes a dialog box to pop up when you try to go to the site. You have to specify a correct username and password, as specified in the .htpasswd file, in order to gain access to the site.
After realizing there might be a connection with this, I tested using the flash uploader on one of my sites with the htaccess authentication turned off. Sure enough, it worked like a charm. So after realizing that the HTTP Error was definitely related to this, a solution was easier to find.
The solution that worked for me was to create an .htaccess
file in the wp-admin
directory. The htaccess file should have the following rules in it:
AuthType Basic
AuthName share
Satisfy Any
Order deny,allow
Allow from all
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
Since adding this file, I’ve been using the image uploader on my protected sites without a problem.
You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
1. Moloko
June 25th, 2009 at 1:07 pm
Man, this is great. It solved my problem big time!
Thank you very much!
2. Wordpress Flash Upload HTTP Error | solidhex.com
July 20th, 2009 at 1:41 pm
[…] when you try to use the Flash upload feature. Here’s a nice workaround per Nerd Star Gamer: https://blog.nerdstargamer.com/2009/wordpress-upload-http-error-fix/ This entry was posted on Monday, July 20th, 2009 at 10:41 am. It is filed under WordPress and […]
3. Opicze
July 27th, 2009 at 6:05 pm
THX VM man ๐
4. Carl
August 29th, 2009 at 3:19 pm
It worked for me too! Thank you very much!
5. ronino
January 10th, 2010 at 1:21 pm
Thanks for your suggestion, I can now finally use the flash uploader. Actually it works without the mod_security part, so you can leave that out.
It would have been nice if you had explained what you are actually doing with that .htaccess to not let us introduce security holes by accident…
6. psperkins
January 19th, 2010 at 4:32 pm
Thank you soooo much for this. I would have arrived at the same conclusion eventually, but you just saved me probably HOURS of frustration, and I REALLY appreciate that. This solution worked perfectly.
7. David Balderas
January 25th, 2010 at 12:15 pm
Yeee!!! It worked. It saved me for more hours googling. Thanks!
8. Lee Peterson
March 10th, 2010 at 6:00 pm
THAT DID IT! Holy crap. There goes my dev setup process. LOL
Thanks so much for sharing.
9. romi
May 18th, 2010 at 11:56 am
It worked for me too! Thank you very much!
10. christoph
June 15th, 2010 at 1:28 pm
thanks a bunch – it’s so awesome that on the internet every problem has to be solved just once. thanks a bunch
11. Michael
December 5th, 2010 at 3:21 pm
Thank you very much! I have spent many time looking for solution. You are great!!!
12. Rachel McCollin
January 6th, 2011 at 11:01 am
Thank you! I have spent most of the afternoon trying to fix this problem, having set up protected access to my school PTA’s site this morning. At last it works again!
Many thanks.
13. Rick
March 18th, 2011 at 7:41 pm
Thanks, worked perfectly!
14. KittyAddict
April 29th, 2011 at 10:31 am
It didnยดt worked for me, but I figured out the issue was with the flash uploader. The “browser uploader” worked just fine. Now I have a hunch that this could be also a flash issue. File permisions were the same, wordpress version, plugins and so on. I tried everything and only switching to the old uploader helped.
15. Kat
June 11th, 2011 at 1:58 am
Genius!
16. Jeremy
June 17th, 2011 at 2:25 pm
Spot on! Thanks. Asking the right question is always key to getting the right answer, which with WordPress issues seemingly takes a while sometimes :S
17. WP e-Commerce
September 10th, 2011 at 5:08 pm
[…] https://blog.nerdstargamer.com/2009/wordpress-upload-http-error-fix/ […]
18. Paul
September 29th, 2011 at 7:47 am
thanks! so glad i came across this post. worked a treat for me, i had exactly the same issue (but only in Google Chrome) I was sure i was gonna search for days to find a fix for this… nice save .. thanks!
19. Andrei
October 29th, 2011 at 10:51 am
Oh, it’s not working here ๐ I still have this error…
20. jc ospino
November 15th, 2011 at 3:27 am
man it worked!, although my .HTACCESS file was not in the admin directory it was in the root, so i added the code to the existing .htaccess file and VOILA!
thanks people! what goes around comes around
21. Gonzalo Sanchez
February 6th, 2012 at 11:31 am
Everything indicates that the error “HTTP Error” while uploading images is caused by a change in the Apache FastCGI module (mod_fcgid 2.3.6) that limits the value of the parameter MaxRequestLen to 128KB (very low). Previously this limit was 1GB. Therefore this problem is likely to occur only on servers running PHP in FastCGI mode and only when trying to upload a file larger than 128KB.
The final and stable solution to this problem is well explained in the link that leaves our friend ntarantino.
http://wiki.mediatemple.net/w/(dv)_4.0:Enable_FastCGI
and it works perfectly! ๐
but that solution requires access and modify the configuration file of FastCGI. It can be done via SSH or asking the support team of your server to do so.
An intermediate and fast solution I’ve found, for those who need to solve this problem right now and can not modify that file themselves, is as follows: – Install the plugin WPlupload (nice and efficient plugin that replaces the WP file upload form) – In the plugin settings indicate 128kb or less in the “Chunk size” – Enjoy ๐
Tell me if this solution works for you.
Gonzalo.