WordPress error: The uploaded file could not be moved to

Error message came up when my friend upload a photo :

The uploaded file could not be moved to xxxxxxx

Yes, it seem he change to new host and since wordpress automatically save old location to database the error show up.

Solution

Open Admin Page -> Settings -> miscellaneous

Make sure value of Store uploads in this folder set to wp-content/uploads

Click Save Changes and try upload photo again.

Everything should be OK now 🙂

7 Comments

  1. This is the basic solution but after the change of directory most frequently the upload still fails until you change the permissions for the directory to 777 (open to anyone to write to the directory). This is a security weakness and should be avoided. I can’t find any information that suggests a more secure alternative. I think this is a issue WordPress should address to avoid the security risk.

  2. I’d just like to add that with my server WordPress kept creating the upload directory if it was not present. I would set permissions to 777 and no go, errors as above.

    No errors showed up in the server logs.

    owner and group of the WP-created uploads folder was apache, but all other folders and directories had a different owner and group. So I used my server control panel to create the uploads directory, then set permissions once again, and this time it worked.

    My ftp software (“Transmit”) could show me the owner and group of a folder but not change it. I succeeded when I deleted the one WP created and made a new empty upload folder in it’s place, then set permissions on it to 777.

    I hope that helps anyone who is getting the same thing

    Oh and I did do the solution as shown in the article first, so I expect that is a required step as well as the additional steps I took.

  3. I ran into this same problem with one hosting company. The only way they allowed for uploads was to chmod the directory to 777 which = not secure, not acceptable. This host wouldn’t allow for disabling mod_security in apache either. I found a plugin that allowed me to upload plugins and images to their correct respective folders: WP-Easy-Uploaderhttp://wordpress.org/extend/plugins/wp-easy-uploader. I am not affiliated with the creators of this plugin – I just appreciate all the time and headaches it saved me and hope it will help others.

  4. Your issue could also be the size of the file you’re trying to upload. You’ll get the same error on WP3 if you exceed your max file size.

    I fixed mine by locating the php.ini file (ubuntu /etc/php5/apache2/php.ini) and changing the upload_max_filesize. Then restart apache.
    Glenn

  5. @Eric Kinney Thank you so much. This solved my problem. I deleted the uploads folder created automatically by wordpress and created a new one, set permissions. and it worked.

  6. This solved the problem for me:

    Problem: When trying to upload a plugin to WordPress, the following error is given:

    The uploaded file could not be moved to /home/user/public_html/domain.com/wp-content/uploads/2010/12.

    Solution: Within WHM, under Main >> Service Configuration >> PHP Configuration Editor, the “upload_max_filesize” was incorrectly set to 64MB, when it should have been set to 64M.

    Notice the extra B in MB? It causes the error. Just an FYI…

Comments are closed.