Skip to content

How to fix "Upload: Failed to write file to disk" error in WordPress?

The “Upload: Failed to save file to disk” error is one of the most common problems that WordPress users may encounter. This error occurs when trying to upload files using the media uploader in WordPress and prevents you from adding new images, videos or documents. There are several potential causes of this error, but fortunately, there are also different ways to solve it. Below are some ways to help you solve this problem.

1. Check and change folder permissions

One of the most common causes of this error is incorrect directory permissions on the server. WordPress requires the appropriate permissions to write files to disk. The standard permissions for the wp-content directory where uploaded files are stored is 755.

You can check and change this with an FTP client like FileZilla. After logging into your FTP account, go to the wp-content directory, right click and select "File permissions". Make sure permissions are set to 755.

2. Changing php.ini settings

Another potential reason for the problem with writing files to disk could be the PHP configuration on your server. If the upload file size limit is too low, you may encounter this problem.

To change this, you need to adjust the php.ini file on your server. You can do this using the server control panel or FTP client. In the php.ini file you need to find the following lines:

upload_max_filesize = 2M post_max_size = 8M

You can increase these values, for example, to 64M by saving the changes and restarting the server to apply the new settings.

3. Using a WordPress plugin

If the above methods do not help, you can use one of the many WordPress plugins available that can help solve this problem. One example is the “WP File Manager” plugin, which allows you to manage files and directories directly from the WordPress administration panel. This plugin also allows you to easily change directory permissions.

4. Contact hosting support

If all of the above methods fail, your last step may be to contact your hosting support. This may be a server configuration issue that is not available to you as an end user. Technical support should be able to quickly identify and resolve the issue. In summary, the "Upload: failed to save file to disk" error in WordPress, while annoying, is usually easy to fix. The key to solving this problem is patience and a methodical approach to each step. Remember that you can always use the technical support of your hosting if you are unable to deal with the problem yourself.

Check out the offer of 1500+ Premium WordPress plugins and themes!