Fix “The uploaded file could not be moved to…” Error

You have used Wordpress normally for last five years, but one day you upload a picture for your new post and it never complete the uploading process. The system keeps showing the message "The uploaded file could not be moved to...". This is very annoying, because you know your server's disk space haven't full yet, all other functions are still working well. This issue could happen when you upload any type of data or a new plugin. Hopefully, you can pick one of these solution to solve this issue out:

Fix "The uploaded file could not be moved to..." Error

== Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error ==

Set the Default Folder for Uploads in WordPress
1) Login to WordPress and go to Settings > Media.

2) For the input labeled: Store uploads in this folder, specify the following as the value if it is blank:

wp-content/uploads

3) Save changes and test your ability to upload images. If you still have issues, move on to the next solution.

Changing Folder Permissions via FTP
On most VPS servers, you have to set permissions and ownership. Said differently, if you have the ability to set permissions but you are not the owner, then you will not be able to move or copy files into that folder.

WordPress tries to move uploads to the designated folder.

However, if it does not have permission to do so, that would result in an error. It will only succeed if your write permissions are valid. Therefore, make sure your write permissions are correctly set and that you own the /uploads folder. Your FTP client displays the owner of the folder and is usually the username connected to the ftp server.

Below are instructions on how to change folder permissions via FTP:

1) FTP to your server, and navigate to the wp-content/uploads directory.

2) There, change the permissions of the /uploads directory to 777 (i.e., chmod to 777). In most FTP clients, you can right-click on the folder to get to the screen that allows you to change the folder permissions. If it asks you whether you would like to apply changes recursively, enable that as well.

3) Check WordPress by adding a new post and uploading an image. If it works, move on to the next step. If it doesn’t, then move on to the next solution.

4) If the previous step worked, now we’ll go back and change the permission of the /uploads folder to 755 (apply changes recursively). We’re doing this to avoid having a write-able (777) folder which is a security vulnerability.

NOTE: Do not leave your permission set at 777 – it exposes your site to hackers.

5) Check WordPress by adding a new post and uploading an image. If it works, then your issue is resolved. If it doesn’t, then move on to the next solution.

Changing Folder Permissions via Hosting Control Panel
Sometimes, the FTP user does not have the same privileges as the account owner.

To ensure that changing folder permissions isn’t the solution, try logging into your host’s control panel and check the folder permissions from the File Manager.

If they are correct, then move on to the next step. If is is not correct, edit the folder permission there and re-test the upload function through WordPress.

== Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error =

Creating a New Uploads Folder
1) FTP to your server, and navigate to the wp-content/uploads directory.

2) Rename the uploads directory to uploads-old.

3) Now, create a new folder named uploads. Change its permissions to 755.

4) Copy all sub-folders and files from the /uploads-old directory to the new /uploads directory.

5) Check WordPress by adding a new post and uploading an image. If it works, then your issue is resolved. If it doesn’t, then move on to the next solution.

Turn Off PHP Safe Mode
For some folks, turning off PHP Safe Mode may be the solution to this issue. However, not all users will be able to do this as many hosts restrict access or edit privileges to this file.

1) Navigate to your server

2) Locate the php.ini file. It is usually in your /etc directory from the root.

3) Open php.ini in a text editor and change the PHP Safe Mode value (if it exists):

On

to this:

Off

4) If the line does not exist, then add it.

5) Test your upload capabilities in WordPress.

Other Solutions
There are other potential solutions available however they are far more technical and require understanding of critical server files.

Therefore, in the interest of preventing you from causing damage to your site and server, I won’t go into those here. At this point, if you are still having the issue, contact your host and have them resolve it.
I hope this was useful for folks having this image upload issue. Please let me know which solution worked for you in the comments below.

== Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error == Fix "The uploaded file could not be moved to..." Error ==