Archive for the ‘WordPress Error Messages’ Category

WordPress Error: The uploaded file could not be moved to…

One of the things that never ceases to amaze me is how I can have two different WordPress blogs with the same versions of everything on each and yet I get an error message on one and not on the other. This particular error message cropped up when I tried uploading an image through the flash uploader.

The uploaded file could not be moved to /home/username/public_html/blog/wp-content/uploads/

Having first checked that I had an uploads folder and that permissions were set to allow writing I opened the folder with my FTP client and checked that WordPress had been able to create the image folders. It had and these too were set with the correct permissions.

After a bit of research online I tried several suggested fixes but none of them worked. So, after a little bit of tinkering I found something that did. The following code needs to be added to your htaccess file:

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

Now, two things. Firstly the htaccess file needs to be wherever the WordPress root is. The website I had the error on had the blog at second level so this was where the htaccess file was needed. Secondly this code needs to be put above the standard WordPress code – the fix did not work when it was added below the existing code. So you should end up with something like this:

# BEGIN WordPress
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

Bookmark Or share
AddThis Social Bookmark Button