WordPress 2.5 image upload problem : SOLVED

by Josh Highland on March 30, 2008

This afternoon I upgraded my blog to the latest version of wordpress, 2.5. The install went great and it was simple to do. I didn’t realize that I had any problems until I went to make a blog post and upload an image. When I tried to upload, I was greeted with the following:

grey WordPress 2.5 image upload problem : SOLVED

Something was for sure messed it. I tried it in several browsers, but had the same results. no luck. I started to go some searching online but since wordpress 2.5 is so new, there was little info to be found. After about an hour of stumbeling around I came across a post on a forum where someone said they got the image upload to work by adjusting their .htaccess file on thier site with the following code.

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

I made the change to my .htaccess file, and like magic the image upload feature started to work again!

I am making this post in the hopes that other people with similar problems will stumble across this post and be able to fix their problem with out having to wade through all the pages of people trying to diagnose what the problem is when the solution is super easy.

{ 27 comments… read them below or add one }

1 Jonathan March 31, 2008 at 1:35 pm

I’m getting the same error, but thus far the .htaccess solution hasn’t solved it for me. I actually have two .htaccess files, one in the root, one in /wordpress (a subset/copy of the data from the root problem) – I’ve edited both, but to no avail.

Any ideas?

2 Ana April 1, 2008 at 9:20 am

I had the same problem, but your tip worked fine for me. Thank you!

3 Suhaimi April 1, 2008 at 7:11 pm

I tried your solution and the error message is now disappeared.
Unfortunately I get another error that says:
The uploaded file could not be moved to home/…/wp-content/uploads

I had tried to Add Full URL Path to Files at Settings/Misc to no avail.

I’m still surfing for answers …

4 Josh Highland April 1, 2008 at 11:14 pm

make sure that the directory that you are uploading to has the proper settings. try chmod 666 or 777

5 lughdailh April 2, 2008 at 1:51 pm

I don’t found .htaccess!!!

6 Mario April 2, 2008 at 3:15 pm

Thanks a lot for this suggestion. It Works!!! I translate this post into spanish for the latinamerican community with your credits.

Good Luck

7 Nadav Perez April 4, 2008 at 11:45 am

Thanks, worked like magic.

lughdailh – if the file does not exist, create it in the wordpress root folder and put the code above in it.

8 Rohit April 6, 2008 at 9:13 am

Thanks man,
It really works fine and all my problem vanished like anything.

9 joemar April 8, 2008 at 7:19 pm

for those who have their blog in a subdomain of an add-on domain, you have to insert the code to the .htaccess of the main domain. confused? no other way to make it any clearer. just figured this out for my subdomain blogs.

10 Shaun April 9, 2008 at 8:15 am

thanks josh, you’re a life saver. I’m also spreading the word ;)

11 Stuart April 9, 2008 at 12:10 pm

Thanks Josh – nice quick fix.

12 criscom April 10, 2008 at 12:30 am

Hi Josh,

excellent work! you saved my day. just one question: in order to get your solution working i had to put it at the start of my .htacess-file. does this mean that the code after the tag will not work? Here’s my code in the .htacess-file:

# BEGIN WordPress

SecFilterEngine Off
SecFilterScanPOST Off

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

13 criscom April 10, 2008 at 12:31 am

sorry, not all of the code is displayed:

# BEGIN WordPress
i have left out the brakets

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

IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

14 Ritz April 12, 2008 at 9:01 pm

Yes, this made my headache go away. I reinstalled all of wp 2.5 and that didn’t fix it originally, but this did. thanks a lot!!

15 James April 13, 2008 at 3:44 pm

After trying all of the other fixes, this is the one that finally got it working. If your blog is not the root of your site, then the .htaccess file is in the root folder of your site.

16 Cat April 17, 2008 at 9:30 am

Thanks! Definitely helpful! I’m overall loving the new version of Wordpress, but this was an interesting bug.

17 Sage April 20, 2008 at 7:57 pm

I have tried all your solutions and I still get the following message after trying to upload an image, it is very frustrating. the htacess modifications do not work on my Mac running 10.5 in safari or FF.

Fatal error: Call to undefined function wp_constrain_dimensions() in /home2/newyorka/public_html/wp-admin/includes/image.php on line 173

any other suggestions?

18 Josh Highland April 20, 2008 at 11:49 pm

I would make sure that wp-includes/media.php is uploaded. The function wp_constrain_dimensions() is defined in that file, and id needed for wp-admin/includes/image.php to work.

19 Sage April 21, 2008 at 6:49 am

Yes that file is loaded. it has the current date and I can view the file. One of the solutions I found on the web last night had me change a few lines in it to disable the flash component of the new WP image loader. I searched through the file , changed the lines of code and installed a plugin that was supposed to by pass the Flash loader. All failed and the upload error message was the same. So I deleted both the admin and includes folders from my server and re installed them from a fresh download of WP 2.5 and we are still unable to upload any media. I am thinking I should put the old 2.3 admin and includes folders in place but I did the database update and am concerned that the updated DB will not respond to the older versions. Any thoughts. Maybe I should replace the new media.php with an old one?

20 Sage April 21, 2008 at 10:04 am

Some things seem to have resolved but I am still having problems. I checked my uploads folder and was surprised to see almost 40 photos there that I had uploaded last night. Many duplicated of what I had been getting error messages for, I downloaded a few to make sure they were complete files and not just unpostable ghosts. I deleted the copies and when I opened WP again I found the photos in the Media library. I was able to make a post but when I needed a photo that was not in the Media space I uploaded it and it seemed to go in, however when I went to the media list it was an ikon with a ? in it. I checked the server and the file is complete and viewable but WP cannot find it.
While viewing the post one other photo became a ? and I had to find it again in the Media space. It had become a ? there too, and then it was back so I could repost it in an edit. WP 2.5 seems to be unstable. but one thing I noticed and appreciate is the automatic save while writing a draft. I tried to save and suddenly Safari could not get to the server. Had to restart the whole machine, then I found the draft and it was complete except for one sentence.

21 Dale Lewis April 27, 2008 at 11:45 am

Thanks for the fix! I was searching for a solution and found your site.

22 Craig April 30, 2008 at 4:45 pm

Your post was spot on. My problem was solved from the inclusion of the code you posted. Thanks.

23 mayooresan May 4, 2008 at 9:09 am

I tried your tip, it didn’t work out for me. I used no-flash uploader plug-in!

24 Andrew Raj May 7, 2008 at 2:01 am

Thank you !! It worked !!

25 bradley May 26, 2008 at 12:18 am


if the /uploads/2008/05
is set to chmd 0777
then i can upload to it, HOWEVER, I’ve read this, “Directories should have permissions of 755. NEVER 777″

I fear having my directory set to 777. Please advise. Thank you.

26 dorin September 23, 2008 at 3:02 am

it works!
thank you!
was a real mess for my last 3 days!

27 subhendu Das March 19, 2010 at 8:34 am

Hi I integrated wordpress in my cakephp project where already 2 .htaccess file one in root another in app/webroot ….i keep wordpress blog in webroot folder.but everything working fine in blog except image uploading.I will try to do it by using below .htaccess code but faile.

anybody can help me then I greateful for that……..

SecFilterEngine Off
SecFilterScanPOST Off

Leave a Comment

{ 9 trackbacks }

Previous post:

Next post: