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







{ 27 comments… read them below or add one }
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?
I had the same problem, but your tip worked fine for me. Thank you!
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 …
make sure that the directory that you are uploading to has the proper settings. try chmod 666 or 777
I don’t found .htaccess!!!
Thanks a lot for this suggestion. It Works!!! I translate this post into spanish for the latinamerican community with your credits.
Good Luck
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.
Thanks man,
It really works fine and all my problem vanished like anything.
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.
thanks josh, you’re a life saver. I’m also spreading the word
Thanks Josh – nice quick fix.
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
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
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!!
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.
Thanks! Definitely helpful! I’m overall loving the new version of Wordpress, but this was an interesting bug.
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?
@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.
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
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.
Thanks for the fix! I was searching for a solution and found your site.
Your post was spot on. My problem was solved from the inclusion of the code you posted. Thanks.
I tried your tip, it didn’t work out for me. I used no-flash uploader plug-in!
Thank you !! It worked !!
hi,
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″
http://www.tamba2.org.uk/wordpress/chmod/
I fear having my directory set to 777. Please advise. Thank you.
YESSSSSSSSSS!
it works!
thank you!
was a real mess for my last 3 days!
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
{ 9 trackbacks }