WordPress Upload HTTP Error Fix

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:

A Screenshot of the HTTP Error message when attempting to upload a files in WordPress

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. You can leave a response, or trackback from your own site.

Comments

1. Moloko

Man, this is great. It solved my problem big time!

Thank you very much!

2. Wordpress Flash Upload HTTP Error | solidhex.com

[...] when you try to use the Flash upload feature. Here’s a nice workaround per Nerd Star Gamer: http://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

THX VM man :)

4. Carl

It worked for me too! Thank you very much!

5. ronino

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

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

Yeee!!! It worked. It saved me for more hours googling. Thanks!

8. Lee Peterson

THAT DID IT! Holy crap. There goes my dev setup process. LOL

Thanks so much for sharing.

9. romi

It worked for me too! Thank you very much!

10. christoph

thanks a bunch – it’s so awesome that on the internet every problem has to be solved just once. thanks a bunch

Leave a Reply

Please note: I love to hear useful feedback from readers. However, if your comment does not include something more useful than "this is great!", it will be marked as spam and deleted.