WordPress 2.5 image upload problem : SOLVED

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:

wp upload25 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
</Files>
</IfModule>

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.

36 Comments

  1. 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. Josh,
    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 …

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

    Good Luck

  4. 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.

  5. 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

  6. 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
    /Files
    /IfModule

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

    # END WordPress

  7. 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!!

  8. 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.

  9. 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?

  10. @Sage:
    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.

  11. 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?
    Thanks,
    Sage

  12. 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.

  13. Pingback: Wordpress Image Upload | The ramblings of Steven Macintyre
  14. 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.