WordPress: The uploaded file could not be moved to Error

WordPress: The uploaded file could not be moved to Error

November 5th, 2011 // 10:30 pm @

When I last did a 5-Minute install of WordPress, everything worked great, except when I tried to upload of a new theme, I got the annoying and somewhat non-descriptive error.  After tirelessly searching the Internet I came across several articles, and a solution to my problem.

Change your permissions – WordPress.org

Taking what I learned in the above article and several other, I boiled it down to a few commands, if you have shell access (if you don’t you really should).

cd into where ever your wordpress is located.
chmod -R 644 *

      • The wordpress article says that no file needs more then 644 and you could probably even do a 640, but I just stuck with 644.

find . -type d -exec chmod 755 {} \;

      • This changes the permissions on all the directories to be 755

chmod 600 wp-config.php 

      • And this makes the wp-config.php file only useable by the webserver, no one else can read or write it

Make Sure you default folder is set correctly

Go to Settings > Miscellaneous and check that the default folder for uploading is set to /wp-content/uploads/. There are times when the folder is not properly defined.

Check htaccess

Something that most articles didn’t talk about was look in you htaccess file.  An article at bloggingtip.net, was talking about adding a few lines to your .htaccess file.  This got me thinking that I don’t remember seeing an .htaccess file out there in my wordpress directory.

After verifying that I really did not have a .htaccess for this directory, I created a .htaccess and added the following lines to that file.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Once I added that file and added these few lines that should have been created as I installed wordpress, but for some reason, it wasn’t so if you run into this problem in one of your wordpress sites, make sure you have a .htaccess file in your wordpress directory to make sure that everything works as you might expect it to.


Category : Featured &Wordpress &Wordpress Tricks

Leave a Reply