WordPress Upload Error Failed To Write File To Disk

How to Fix “Upload:Failed to Write File to Disk” Error in WordPress

Using WordPress is usually a smooth experience but sometimes small nagging problems can waste your precious time. Some users on the WordPress forum have reported a problem that occurs when they are trying to upload images or other media to their site. The error states “Failed to write file to disk” and for some, an “HTTP error.” Now, these errors don’t give much idea to the user as to why they are appearing and what’s the solution to this problem. So let’s learn how to fix this problem.

Tips to fix “Upload:Failed to write file to disk” Error

This error can occur because of several reasons, and hopefully by the end of this article, you would be able to fix this error. Read on.

Solution #1: Check your ‘Upload’ folder permission

Login to your cPanel, or your web hosting account and click on File Manager. Navigate to public_html/wp-content. There, you will find ‘Uploads’ directory. Right-click on it and then click on “Change Permissions” or simply select this folder and then click on “Permissions” from the toolbar at the top. Normally, this ‘Uploads’ folder should have 755 permission, and if this is not the case, then change it to 755 right now. This is because WordPress needs access to write files in your wp-content/uploads directory to enable certain functions, and if this permission is not set correctly, then you will not be able upload media to your WordPress site. So go ahead, check your ‘Uploads’ folder permission by using cPanel or FTP client like Filezilla or any other.

Solution #2: Are you exceeding your storage quota?

This might seem very strange but users do get this error because they are exceeding their storage quota. Users on webhosts with shared hosting plans do get affordable packages, but with very low storage space, such as 500MB, 1GB, 2GB and such. If you are the one who is hosting multiple WordPress sites and upload lots of pictures then chances are that even 1GB storage will soon become full. If the storage quota is exceeding, then your web host won’t allow you to upload any other files, and thus this error.

To know how much storage space you are using, and how much is allocated to you as per your web hosting plan, you can login to cPanel and check the left sidebar. Notice the “Disk space usage” field, which will inform you how much disk space you are using, and your total space as per your hosting plan. If you are exceeding or very near to filling out your disk space, then it’s time to upgrade to a better plan, or delete files in your account that you do not require. However, in most cases, it is better to upgrade to a plan with more disk storage space so that you don’t run out full again.

Solution #3: Clear temporary folder of the server

Sometimes this issue occurs if the temporary directory where PHP stores the newly uploaded file is full. Normally users don’t have access to this temporary directory and that’s why you will need to contact your web host and ask them to clear the temporary files in the server directory. Contacting support of your host will help you here.

Conclusion

Have these solutions helped you in solving “Failed to write file to disk” error? If all of these solutions failed, it is time to contact your web host by creating a support ticket or live chat. Explain them that you are getting this error and from when. This can also be a server issue sometimes and that’s why they will be able to help you or at least point in the right direction.

Do check out our WordPress problems and fixes section to fix all your everyday WordPress related problems.

5 Effortless Steps to Fix “failed to write file to disk” in WordPress

You’ve just created the most perfect content for your website. You’re getting ready to upload the most amazing image for the post and you see it: “Upload Failed to Write File to Disk.” As frustrating as this can be, it’s actually not overly difficult to fix in most cases. As long as you have access to the root folders of the website itself, it may not take a great deal of effort.

What Causes the “Failed to Write” Error?

In the majority of cases, the failure to write to disk is caused by incorrect folder permissions. As a result, WordPress assumes that files cannot be written to the directory. This can be caused by bad plugins or a major change on your web hosting server.

Some attacks from hackers may also change folder permissions, which gives them direct access to install files of their own. This is often the case when a script overwrites those permissions and places a “phishing” fake website within your folders.

In any case, here are the steps to fix the “failed to write file to disk” problem and restore your folder permissions.

Step 1: Using FTP Client Software

In order to change folder permissions of your website, you need FTP client software. One of the most common of these is Filezilla. It’s a free application and quite easy to use. Dreamweaver is another, or you can access the file permissions from the “File Manager” tool if you use cPanel from your web hosting provider.

NOTE: You will need the FTP login credentials from your web host for the software. If you don’t know this information, you will have to contact the hosting company.

Step 2: Accessing File Permissions

Once you have access to your website’s system from the FTP program, find the folder: “wp-content.” This is where the majority of the files you create will be stored. In Filezilla, you right-click the folder and select “File permissions…” on the bottom. The software will bring up a new window called “Change file attributes.” It is from here that you will make the necessary adjustments to fix your file system.

Step 3: Changing the Numeric Value of Folders Only

In this new window, find the text field labeled: “Numeric value.” Change the number in this field to: “755.” This sets the permission to allow the owner, you, to add content to this folder. Some people will attempt to put in “777,” which may give you access. However, it will also open the website for others to have access to those folders as well. It’s not advisable to change the numeric value to 777 unless you are temporarily testing the system.

Make sure the “Recurse into subdirectories” option is selected. This will make sure all subdirectories within wp-content are changed as well.

Select the “Apply to directories only” option on the bottom. You don’t want to change the permission of files themselves at this point. Once you’re done, click the “OK” button on the bottom.

Step 4: Changing the Numeric Value of Files Only

Now that the folders are fixed, it’s time to verify the files are set correctly as well. Right click the wp-content folder and change the permissions again.

In the numeric field, change the number to “644.” These will also need to recurse into the subdirectories. However, this time you’ll select the option for “Apply to files only.” Once you click “OK,” Filezilla will do the rest.

Step 5: Checking the Temporary File Directory

Once the file permissions are set, you should be able to upload images and files to WordPress. If you’re still unable to upload, the temporary file directory may be full. WordPress uses a temporary file directory in PHP during file transfers. In this case, you will need to contact your web host to have them empty out this directory. This is often a hidden location, and you may be unable to access this area with Filezilla or any other FTP program.

Protecting the Site with Plugins

Many people will use backup and restore plugins in the event of major changes such as this. In some instances, this may not be practical simply because it takes time to restore the entire website. However, it’s an excellent option in the event of a more severe disaster. It’s always a good practice to have security measures in place to prevent errors such as these because of external sources.

There are many things that can change the folder permissions of your website and cause a “failed to write file to disk” error. In some cases, you may even be able to identify a plugin causing the issue. However, it may not be a bad idea to scan the website for malware. It’s better to err on the side of caution than to be at the mercy of an attack. Learn more about how to protect your website with these 5 essential security features.

Do you keep your file system protected with antimalware plugins? What kind of errors have you come across in WordPress?

Author: Kaumil Patel

Kaumil Patel is the Chief Operating Officer of GreenGeeks and has over 13 years of experience in the web hosting industry working for and owning web hosting companies. Kaumil’s expertise is in marketing, business development, operations, acquisitions and mergers.

WordPress upload error failed to write file to disk

a WWX d ypjoT lyeGx b MzGci y Fn A D oA i Ve g mMRh i Dtogb t Hf a FXR l k O wq c yJbWF e mSY a QYlvo n udQne

I had the same problem. It’s REALLY frustrating because one day you can upload files and suddenly, one day, you can’t….and so you Google the problem, where everyone tells you some bulls*t about file permissions and it takes you an hour to find out how to check these, and then you find out there was nothing wrong with them anyway, so you’re back to square one.

The solution is to clear the temporary folder on your server.

I’m not exactly sure how you do that, but I think probably via your server’s cPanel. My host (Blue Host) did it for me after I had a brief text chat with their customer support. They fixed it very quickly and told me what the problem had been.

To the people here and on countless pages on Google, which I’d trawled through, could you please explain why file permissions would suddenly magically change all by themselves…or are you simply repeating what you read somewhere else?

Resolve Failed to Write File to Disk Error in WordPress

Mostly, the WordPress users encounters the frustrating error that is “Upload : Failed to write file to disk” error. You get this error whenever you upload files in WordPress.

Why Failed to Write File to Disk Error Occurs?

There are various reasons for the occurrence of this error. The most common reasons are the incorrect file permissions. As you know, based on the files and folders permissions the web server controls the access to the files. The files and folder can’t write on the server if it finds any single incorrect permissions.

You might get following error messages when you upload any image or any files from WordPress admin area:

Unable to create directory wp-content/uploads/2016/03. Is the directory writable by the server?
WordPress has failed to upload any file due to the error in writing file to disk

Remove WordPress Upload Error “Failed to Write File to Disk”

Step 1: Using FTP client software

Here, you will need a FTP client software in order to change the files permissions of your website. The most common application is FileZilla which is free and easy to use. If you use CPanel from web hosting provider, you can access the file permissions from the File Manager.

Note: You must need FTP login credentials from the web host. If you haven’t this information then you need to contact the hosting company.

Step 2: Accessing File Permissions

So, here I am assuming that you have accessed website’s system with the help of FTP program. You need to find the folder wp-content where the number of files get stored. Select the file permissions by right clicking on the folder and you will get a new window named as Change file attributes. So, here you are going to make adjustments according to the file system you want to set.

Step 3: Change the numeric value of folders

Here, you need to find the text field which is labeled as Numeric Value. What you need to do here is to change the number of the field to 755. If you are just temporarily testing the system, you can change the numeric value to 777. However, while changing the numeric value to 755, it just not only give you access but also make the website available for others to access to the above folders as well.

You also need to check the Recurse into sub directories option so that whatever the changes will be done in wp-content, the subdirectories will also get changed. Select the Apply to directories only option which is at the bottom.

Step 4: Change the numeric value of files

As we have done with folders, now it’s time to correctly set the files as well. You need to right click on the folder named as wp-content and do change the file permissions. Now, what you need to do is to change the number to 644. You will select the option for Apply to files only.

Step 5: Check the Temporary file directory

I don’t think that there is any step left to fix WordPress “Failed to Write File to Disk” error. As you have set the file permissions, you are now able to upload files to WordPress.

If in case you are not able to upload then you need to check out temporary file directory, it may get full. You may be knowing that the WordPress during the file transfers uses temporary file directory in PHP. To get them empty out of the directory contact to the web host.

Conclusion

The above methods are just simple stairs you need to climb to make the permissions according to which failed to write file to disk error will get resolved. I hope this article helped you in fixing the upload : Failed to Write File to Disk error.

WordPress Error : Failed to write file to disk

When troubleshooting error messages similar to "Failed to write file to disk", the most common causes include:

  • The server’s hard drive is full
  • The server’s tmp folder is full
  • There are not sufficient privileges set to the folder being written to

This error, "Failed to write file to disk", within WordPress generally means that the tmp folder is full. While there could be other causes of the error, a review of posts in WordPress’ forums shows the issue is most often with your php tmp folder setup, upload_tmp_dir.

If you are an InMotion Hosting Customer

The default WordPress installation with InMotion Hosting has no problems with the tmp folder and how WordPress uploads images. If you are getting this error, Create a phpinfo.php file and check what the "upload_tmp_dir" is set to. If it is set to:

  • "no value" – WordPress is defaulting to the /tmp folder on the server. This is rare, but the /tmp folder may have become full. Please contact our Support Department for further assistance.
  • something other than "no value" – It would appear that you have a custom folder set for your upload_tmp_dir. Please ensure that you have that folder’s permissions set to 755.

If you are not an InMotion Hosting Customer

If you are not an InMotion Hosting customer, the same items as above generally apply. If you have not set a custom upload_tmp_dir, then you’re using the server’s default tmp folder and you should contact your host and ask for help with checking to see if the /tmp folder is full or not.

Leave a Reply

Your email address will not be published. Required fields are marked *