How to Fix The Upload Failed to Write File to Disk Error in WordPress
Have you ever tried to upload pictures to your WordPress website and received this error message Upload: Failed to write file to disk? If you are currently seeing this error, don’t panic!
In this article, you will learn a couple of easy ways to fix this error quickly. Even if you are just starting out with WordPress, you should be able to follow through easily.
In This Article:
What Causes Failed to Write File to Disk Error in WordPress?
There are a couple of reasons why you may be seeing this error. The major cause, however, is incorrect folder permission.
When you create a WordPress website, your web server creates folders in which files are stored. To access these folders and store (write) files into them, WordPress needs to be given appropriate permissions. If a folder fails to provide the needed permissions, WordPress will display “failed to write to disk” error message when you try uploading to that folder.
Also, you might experience this error if the quota limit of your server has been exceeded, or when the temporary file directory in your web server gets filled.
What You Need to Fix This Error
To fix this error, you will need a means of accessing the folders in your web server. The easiest way is with an FTP client. While there are many FTP clients out there, for this tutorial we shall be using FileZilla, and we urge you to do the same.
Guide to Fix Failed to Write File to Disk Error
There are a couple of methods for fixing this error. The first thing to try is changing the folder permission with an FTP client. Second, check if disk limit on the server has been exceeded. And finally, empty the temporary file directory.
-
Change Folder Permission via FTP Client
If you don’t have FileZilla client, head over to FileZilla’s website and download it for free. It has both Windows and Mac versions. Once you have it installed and running, connect it to your WordPress website. You would be asked to provide your host, username and password.
The host is your website domain, for example, mywebsite.com. Then enter the username and password in the correct entry fields (you can get these details from your webhost). In the port field, put 22.
Once a connection with the server has been established, locate the “wp-content” folder and double click to open it. Within this folder, locate the uploads folder, right-click on it, and select “File permissions”.
A dialog box with numerous checkboxes would pop up. Don’t let the numerous checkboxes bother you. Just locate “Numeric value” field, and type in the value, “755”. Make sure to check the “Recurse into subdirectories” and “Apply to directories only” radio buttons and click the OK button. That’s it!
If the Failed to write file to disk error still persists, it could mean that the files within the folder haven’t given WordPress permission to access them yet. You can fix that too!
Similar to the previous step, right-click on the wp-content folder and then click on “File permissions”. This time, enter the value “644” into the Numeric value field. Check the “Recurse into subdirectories” radio button. In addition to that, check the “Apply to files only” radio. Click OK to implement these file permissions.
Try uploading a picture to WordPress. It should go through without any error message this time.
-
Check if Quota Limit on Your Server Has Been Exceeded
Quota limit is the maximum storage space on your web server. Your host provider determines it. Some host providers limit it; for others it is unlimited, depending on your hosting plan.
Exceeding this limit will cause file upload errors in WordPress. If you are still experiencing Upload: failed to write file to disk error, check with your host provider if you have exceeded your quota limit. If that is the case, you might have to upgrade your hosting plan. Alternatively, free up some space by deleting files that are no longer relevant from the server. You can do this using cPanel or FileZilla.
-
Empty the Temporary File Directory to Fix Failed to Write File to Disk Error
Temporary folders, or file directories, are very useful for WordPress. As the name suggests, WordPress temporarily stores files in them, after which you can move the stored files to the “upload” folder.
If this folder is full, there won’t be space for files to be stored temporarily. As such, your best bet is to free up some space. Your web host provider is in the best position to do this, so reach out to them for help.
Conclusion
Failed to write to disk error is one common error on the WordPress platform. The good news is that you can quite easily fix it.
In this article, you have learned 3 ways to fix this error. See also how to Fix Updating Failed and Publishing Failed Errors in WordPress Page and Post Editor and how to Fix The “503 Service Temporarily Unavailable” Error In WordPress.
We hope you found it useful, and if you did, kindly share this article with others.
Also, if you run into more WordPress errors or issues feel free to contact our wp support. For more WordPress tutorials check our WordPress blog.
More Resources:
- How to Clear WordPress Cache – Step By Step Guide
- Optimize Images For Web – Complete Guide On How To Do It
- How to Fix “Are You Sure You Want to Do This?” Error in WordPress