If you are using WordPress, then you should know that there is a good chance that you are bound to come across a few errors from time to time. One such error in question happens to be “Upload: Failed to Write File to Disk” and like most errors on WordPress, the reasons are often external. For all intents and purposes, WordPress comes with a fantastic CMS and is a great platform to base your website on but when you start utilizing several plugins at the same time, your performance is bound to take a hit. You are bound to develop a few errors as a result of wrong configuration or as a result of these plugins. The good news is that WordPress comes with all the advanced functionality that you would ever require along with the requisite tools that should enable you to fix this issue right away. In this case, the error is mostly caused by incorrect folder permissions rather than a configuration issue and down below, there are at least a few easy ways for you to resolve the problem right away. So, read the step by step directions posted below and soon, your website should be back to running seamlessly.
1. FTP client:
One of the reasons for the file upload error to creep up in the first place is on account of file permissions; that is you may not be able to write or edit a particular file due to incorrect permissions and the result is this, an upload, failed to write file into disk error. When that happens, what you need to do is to login to your FTP client using the credentials that your host had provided you with. Once you are logged in, access your website’s root directory and locate the public.html folder and the wp-content folder, it contains most of the files that you would have created. Now, right click on the folder titled “uploads”, and you should see the drop down menu open and click on “permissions”. You should see a new dialog box open up, enter in the numerical value of 755 in the box, check ‘recurse into subdirectories’, and finally, choose ‘apply to all directories’ option. This should enable you to set the attributes for the folder in question and you would have to change the file attributes and permissions for each individual file in that folder for this to take effect. So follow the same process as above and instead of the numerical value of 755, you should enter a numerical value of 644 for the file in question. Once you have changed it for all the files in that particular folder, you can go ahead and click on “Ok”.
While the process above may seem a tad laborious, the fact is that you can easily change and rest both the file and folder permissions by the process listed above. However, if your host provides you with a cPanel account, then you can use the same to make the required edits to both your files and folders. All that you would need is to login to your hosting account and click on file manager, the icon you see at the right. Once you click on the same, you should be able to head over to public_html>wp-content folder and then change the permissions for both the folder and all the files that it contains. Just access the wp-content folder and click on “uploads” folder. You would need to right click on the same to see the “permissions”, which you need to change to a numerical value of 755. You also need to change the same for all the files contained within, by the same process and change the numerical value to 644. Now, click on “ok” and you should be done; now reload your website and your error should be resolved.
3. Quota issue:
Yet another reason for why the “upload: failed to write file to disk” error crept in is that you have simply run out of space. Chances are that you are on shared hosting and that means that the space allotted to you would be limited. It is not unheard for any website to exceed the space allotted to it and usually, it should not cause a problem but then again, when you exceed the allocated space, this error is bound to occur with increasing frequency. In order to resolve this error, especially if you have exceeded your allocated space, you may want to delete some of the unused files from your server.
4. Emptying out the trash:
Believe it or not, this error can also happen because you forgot to flush out the temp folder and as a result, most of your allocated space has been used up. Think about your website as an android phone, it comes with limited internal storage and unless you remove the cached files in the same, your internal storage is going to get used up and fast. The same issue is why you are currently facing this error with WordPress; it saves all your files first in the temp folder and then it transfers them to the “uploads” folder. However, when the temp folder is already full, then WordPress is unable to write into the “uploads” folder and this error is bound to happen. The first thing that you need to do is to contact your hosting provider and tell them about the issue you are facing at your end and ask them to resolve the same at the earliest. The other thing that you need to do is to empty out your temp folder a lot more regularly and this should help prevent the issue from developing in the first place.
These are some of the ways by which you can resolve this particular error and it could also be resolved by a simple act as emptying out the temp folder. You may want to check out all the steps listed here, carry them out and you should be able to resolve this error at the earliest.