If you are dealing with the “Upload: Failed to write file to disk” error, it can be more than an annoyance. After all, you cannot upload new files until it’s resolved, which is stressful and forces you to find the solution as soon as you can. Luckily, unlike the errors such as the white screen of death or the “this site is experiencing technical difficulties“, the potential workarounds are much easier and require less effort. Did that comfort you, at least a little? If so, stay calm and collected. Then, follow these steps to learn how to fix the “Upload: Failed to write file to disk” error in WordPress.
What is Upload Failed to Write File to Disk Error?
The “Upload: Failed to Write File to Disk” error in WordPress is an error that prevents you from uploading files such as images and videos to your WordPress site. This error can surface due to a number of reasons.
The most typical reason of the error is incorrect folder permissions (we have listed more items in the upcoming section). But, besides incorrect permissions, this error can also occur due to your WordPress website exceeding the quota limit allowed by the hosting service. There are several ways to fix this issue. You can try changing the file permissions of your uploads directory, empty the WordPress temporary folder, or upgrade your hosting plan to access more disk space.
Why am I seeing the “Upload: Failed to write file to disk” WordPress error?
There are three common reasons:
- Your upload folder permissions don’t allow for writing to it, only reading.
- Your WordPress website’s temporary folder is full or close to full.
- You need to upgrade your hosting plan.
It’s recommended that you try to solve the problem in that order. So, let’s get into it.
Method 1. How to fix folder permissions problem in WordPress to allow uploading
We already wrote an in-depth guide on the steps required to fix the file and folder permissions error in WordPress. Read it if you have any doubts. With that said, here’s how it works in practice. First, you need to choose the medium. It can be one of the two:
- Download an FTP client. It’s third-party software that requires installation.
- Access the FTP or File Manager web app. You open it through the cPanel on your hosting website. It’s immediately accessible and requires no installation.
We can’t demonstrate the process on every FTP client or every hosting cPanel, obviously. Luckily, the steps are very similar, and you should be able to figure it out.
Fixing file attributes on FileZilla
- Download, install and run FileZilla.
- Fill in the credentials provided by your hosting at the time of purchase.
- Once you gained access, open the root folder.
It might be also named public_html, www, or yoursitename.
- Find the folder titled wp-content and right-click on it.
- From the menu, select File permissions…
- Look for a text box next to the Numeric value.
- It should be 755 for folders and subfolders and 644 for files themselves.
- If it’s any different, replace it with 755.
- Make sure Recurse into subdirectories is checked.
- Select the option Apply to directories only if isn’t already.
- Click on OK.
Check whether the same error appears. If so, here’s something else you can try.
- Go back to the root folder.
- Find a file titled index.php.
- Right-click on it and choose File permissions… again.
- This time, instead of 755, enter 644 in the field.
- Click OK.
Additional explanation: On certain cPanels, you cannot enter a single number. Instead, you’ll have three text fields next to each other. Enter 7, 5, 5 or 6, 4, 4 into them instead.
Method 2. Empty the temporary folder on WordPress
f you’re still having trouble, it might be because your WordPress website’s temporary folder is full. It could be frustrating, but you still have hope.
WordPress needs to upload your content to a temporary place on the server before moving it to the Uploads folder for long-term storage. If the temporary folder is too small, it can prevent your content from reaching the Uploads folder, causing the “Upload: Failed to Write File to Disk” error. So, make sure to check if your temporary folder is full!
Just like on your computer, temporary files can build up and fill the space provided by your hosting, preventing you from uploading. The bad news is – you cannot clean the files yourself. Instead, contact the hosting via phone, Skype, through an internal ticket system, or their 24/7 live chat. The representative will not only delete them but also tell you whether they caused the “Upload: Failed to write file to disk” error. If it didn’t, they’ll point you in the right direction after analyzing the situation.
Method 3. Upgrade your hosting plan
So the problem wasn’t with the file/folder permissions and the temporary files are gone. You have to face the reality. It’s possible that you rented too little storage space, especially on a shared server, and by uploading media, you simply ran out. The easiest way to check is to log in to your hosting’s website and look for Disk usage or Resource usage sections. You then have two options:
- Go back to your WordPress Media library. Start replacing, resizing, compressing, and deleting files to reduce their size and extend the lifespan of your website.
- Better alternative: Simply pay a little more for a hosting plan upgrade. Their representatives will help you make a smooth transition. You should be using a WordPress backup plugin just in case.