30 March 2008 @ 18:55Fix WordPress upload error – HTTP error
The inability to upload files in WordPress first showed up in version 2.5. The solution for me was to edit the .htaccess file in the root directory of my webserver (the directory where WordPress is installed). Add the following to the the .htaccess file after the “END WordPress”:
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
If you are having the problem of your .htaccess file losing its changes, you have most likely put something inside the WordPress block of the .htaccess file. Keep any custom changes outside of that block or they will be overwritten.
It seems that this problem still occurs in WordPress 2.6, but the error message is slightly different — “An error occurred in the upload. Please try again later.”
This fix is still necessary in newer versions of WordPress.
by Jon | 42 comments | Tags: .htaccess, bugs, fix wordpress upload error, wordpress, wordpress http error, wordpress upload error
Posted in bugs, wordpress | Link to this
Thanks a lot for this, I was really searching a fix for wp2.5
You’re welcome. I know how aggravating this problem was.
Hey,
That was a very quick and easy help! Thanks very much.
No problem, Pat.
I cant get this to work and its driving me nuts!
Jake, can you give me some more details about what all you have tried and the errors?
This worked for me. I did not have an .htaccess file, but put the above code by itself into a new .htaccess file and it worked fine. Thx.
Thanks man, that worked for me! But what was actualy wrong with 2.5? Why was that needed?
I honestly don’t know what changed in WP2.5 to cause this error. The only thing that comes to mind is the new Flash uploader, but that may have nothing to do with the error itself.
I saw that the server doesn’t recognize the esistence of the “uploads” folder and once You have created it again, after you upload a file, it doesn’t recognize the folder again, telling me the “uploads” folder doesn’t exist.
Hello,
Thanks for the tip, but I still get the ‘http error’ message when I try uploading with the Flash thing. Here’s my .htaccess file. Maybe I have it in the wrong place in the file?
———————————
RewriteEngine On
RewriteBase /
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
SecFilterEngine Off
SecFilterScanPOST Off
———————————
Thanks for any help.
It looks like parts of the rules are missing (update: I just realized that some of that is because the comment was reformatted). For example, here is my full .htaccess file:
Be sure that the rules are exactly like the example in the original post.
Under WordPress -> Settings – > Miscellaneous make sure your uploads folder is set to
wp-content/uploads
Also check the permissions on the uploads folder. Mine are set to 755.

Thanks a lot. Now fixed.
Greetings,
Just moved my wordpress 2.5 installation to a new server and everything works ok, except now I am getting this HTTP error when I try to upload images and one other odd thing, I get a 404 page when I try to hit Save when editing a post.
I followed the instructions above and they haven’t helped at all. Here’s my .htaccess file, which is located in the public_html folder of my account (the main wordpress folder is /wpress). Any idea at all what I could be doing wrong?
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
SecFilterEngine Off
SecFilterScanPOST Off
Avram, your .htaccess needs to be in your /wpress folder, not the public_html folder.
I’ve tried changing my permissions to 755 on my my ‘upload’ folder, but it still doesn’t work. I’m going to try the .htaccess approach. Sorry to sound simple but this .htaccess file, it will have to have a name, can it be anything e.g.
file.htaccess? This .htaccess file will go in my wp-admin folder, is this right.
Hope you can help.
Pete,
That is the entire name of the .htaccess file — .htaccess
The .htaccess file does not need to go in your wp-admin folder. It needs to go up one level and in the same folder as wp-app.php, wp-atom.php, etc.
Eureka and thanks very much, that has indeed worked. Well almost! The image doesn’t appear but a placeholder does. I’ve looked at the html and it has a sort of date like this
wp-content/uploads/2008/06/file name.jpg
If I delete the 2008/06/ from the html it works perfectly. Would you know of a way to get rid of the date part of the html?
Thanks again
Pete
You may need to play with your settings under “Miscellaneous”. It sounds like the problem lies there. Here is how mine is set:
Store uploads in this folder:
wp-content/uploads
Full URL path to files (optional)
(checked) Organize my uploads into month- and year-based folders
Many thanks again, that was the problem. I have another! I’m trying to style the images e.g.”alignleft”. I’ve looked at my style.css and entered a alignleft class and uploaded it, but it’s ignored. Which stylesheet are the image styles in?
I have my WordPress in a sub folder of my static website. http://www.mywebsite.com/blog/wp-content/themes/mythemefolder/style.css
I’ve also tried changing the blog/wp-admin/css/global.css but that does not work either. If you have time I’d grateful for any advice. Thanks.
Pete,
Your style.css will probably be different than mine, but the idea is to find the style for img for entry, and add some classes to them
div#page div#main div#leftside div.post div.entry img.alignleft {float: left}
div#page div#main div#leftside div.post div.entry img.alignright {float: right}
div#page div#main div#leftside div.post div.entry img.aligncenter {text-align: center}
Hopefully this will get you headed in the right direction.
Thanks again for your expert help. I’m now in the right direction.
I’m happy I could help, Pete.
Thanks for the solution! Finally I can upload the images again.
You’re welcome, SilentDog.
Thanks for the tips. I just copy and paste your tips into my .htaccess file and successfully upload the required files.
Thanks again.
[...] Compliments of: http://geek.thinkunique.org/2008/03/30/fix-wordpress-25-upload-error-http-error/ [...]
[...] : http://geek.thinkunique.org/2008/03/30/fix-wordpress-25-upload-error-http-error/ Leave a [...]
Thanks–this fixed my problem!
Cheers
beautiful fix – many thanks.
Wow, thanks this works also in WP 2.7.
[...] googling around, I figured out the similar problem here. Though in my case .htaccess file was blank (in root www directory of wordpress). I added following [...]
This tips didn’t work on mine. here is my .htaccess content
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
SecFilterEngine Off
SecFilterScanPOST Off
i’ve set the uploads folder permission to 755 too. but the error message “HTTP Error. An error occurred in the upload. Please try again later.” is still occured. Why is this happen? thx..
by the way, I use WP 2.7 on my site. thx..
Chika,
Have you tried using the “Browser uploader” instead of the default flash uploader? Under the “Select Files” button there is a link to the “Browser uploader”.
Yes, I’ve tried “Browser uploader” too. I try big (2.69MB) and small pictures (59KB), but it still error. The error message are:
“ALERT – script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker ‘xxx.xx.xxx.xx’, file ‘/home/sloki/user/mySITE/sites/mySITE/www/wp-admin/includes/image.php’, line 146) ALERT – script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker ‘xxx.xxx.xxx.xxx’, file ‘/home/sloki/user/mySITE/sites/mySITE/www/wp-admin/includes/image.php’, line 146) ALERT – script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker ‘xxx.xxx.xxx.xxx’, file ‘/home/sloki/user/mySITE/sites/mySITE/www/wp-admin/includes/image.php’, line 146) Status: 302 Moved Temporarily X-Powered-By: PHP/5.2.6-1+lenny3 Expires: Wed, 11 Jan 1984 05:00:00 GMT Last-Modified: Tue, 11 Aug 2009 03:02:34 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Location: http://mySITE/wp-admin/upload.php Content-Type: text/html; charset=UTF-8″
But those pictures are successfully uploaded to my gallery, though…But why there’s still an error?
Chika,
This “script tried to increase memory_limit” sounds like a configuration issue with your host. You might try to contact whoever is hosting your WordPress installation and inform them of the error.
Hi,
I know this is an old post but believe it or not, I’m facing the exact same problem with WP 2.8.3
I’m pasting your code in the .htaccess file and it works for about 10 minutes, then the .htaccess revents completely on its own and replaces your code with this:
# Engine Off
# ScanPOST Off
Any ideas?
Vassileios,
Are you sure that you put the above text after the “END WordPress”?
My only other idea is that you may have some plugin that is editing your .htaccess file.
Jon
Thanks for sharing a good info.. Keep posted..
So, the solution in the end was have support go through several possibilities. At first, support thought it was WordPress itself creating the errors, but infact it was simply a case of turning off FastCGI in the PHP options/manage domain panel and switch it to PHP 5.3xCGI.
Now, images upload without a issue. Hopefully this will help someone else with the same problem.