Unable to open file for reading. all in one migration

When you see the Upload: Failed to Write File to Disk error on your WordPress site whilst trying to upload a photo for that awesome post you just put together, the only reaction can be pure frustration. And while this problem is not desirable, debugging this WordPress error is quite easy. In this tutorial, we will discuss various causes of the error, and show you how to fix it with easy-to-follow steps.

Unable to open file for reading. all in one migration

  • Why You Get Upload: Failed to Write File to Disk Error
  • Option 1 – Checking Uploads Folder Permissions
    • Option 1.1 – Changing Permissions with FTP Client
    • Option 1.2 – Changing Permissions with Hostinger File Manager
    • Option 1.3 – Changing Permissions via SSH
  • Option 2 – Checking Quota Limit
  • Option 3 – Checking Temporary Folder

Why You Get Upload: Failed to Write File to Disk Error

The Upload: Failed to Write File to Disk WordPress error can surface due to a number of reasons. The most typical cause of the error is incorrect folder permissions. But besides incorrect permissions, this error can also occur due to your website exceeding the quota limit of the hosting service. Finally, in some rare cases, you might be experiencing this error due to the file capacity of the temporary folder of WordPress. Needless to say, all three cases of the error are fixable, and we will show you the solutions to each and every one of them in the following steps.

Option 1 – Checking Uploads Folder Permissions

As stated above, this is the most common cause of the Upload: Failed to Write File to Disk WordPress error. Whenever you try to write (upload) files to any one of the folders on your website, the web server checks whether the folders are allowed to write those files. If any folder does not have the appropriate permissions, the web server is unable to write files to that folder. The same goes for making changes to particular files, as they also have permissions which determine the interact-ability with that file. There are three methods of modifying folder permissions on your web server:

Option 1.1 – Changing Permissions with FTP Client

You can change permissions of files/folders of your website using FTP clients like FileZilla. First, connect to your hosting using FileZilla. Then, hover over to WordPress installation folder (usually it’s public_html) and to wp-content folder. Now right-click on the folder Uploads. Select File Permissions. You will now see a new dialog box open up; in the Numeric value section, enter 755. Now, check the Recurse into subdirectories option. This will apply the same permission to all folders inside Uploads. Finally, choose Apply to directories only in the sub-menu. Finish by clicking OK.

Unable to open file for reading. all in one migration

Keep in mind that sometimes, merely changing folder permissions does not work – you have to change permissions for files residing inside the folder as well. You can achieve this using FileZilla as well. Once again, right-click on the wp-content folder and choose the File Permissions option. Next, enter 644 in the Numeric value field. Finally, check ‘Recurse into subdirectories’, and this time, select Apply to files only. Click OK to save your settings.

Option 1.2 – Changing Permissions with Hostinger File Manager

If you’re using a WordPress hosting service like Hostinger, you can change folder permissions easily through the control panel provided by the service. To do this, log in to your web hosting account through File Manager.

Unable to open file for reading. all in one migration

Then, navigate to the public_html -> wp-content folder. Once inside, you should be able to see the Uploads folder. Right-click on this folder, and then hit on the Permissions button. Now, set the permission to 755 (read and write) for this folder, if it isn’t already set.

Try to upload image again and if the error still pops up, proceed to changing the permissions on individual files inside the Uploads folder as well, just like in the previous step.

Unable to open file for reading. all in one migration

Get the most out of your WordPress website with fully managed and WordPress-optimized web hosting. Get WordPress Hosting

Option 1.3 – Changing Permissions via SSH

Important! It’s recommended to check tutorial on how to manage permission and owners via command line before proceeding with this step.

On Hostinger shared hosting or VPS you can change file/folder permissions via SSH (see our tutorial on how to connect to your account or VPS with SSH). To change permissions using SSH, you only need to use the chmod command, like this:

  1. First of all, access WordPress installation folder. For example, if your WordPress is inside public_html folder, execute:
    cd public_html
  2. Now change permissions to 755:
    chmod 755 wp-content

    By running the above command, the wp-content folder’s permission will be set to 755. If you want to give the same permission to all files and folders inside this directory, simply add the -R flag before 755 in the command.

Option 2 – Checking Quota Limit

Another cause for Upload: Failed to Write File to Disk WordPress error is if your website has exceeded the space limit of the web hosting service. On Hostinger shared hosting, disk space is unlimited, but many other hosting providers set pretty low limits.

Unable to open file for reading. all in one migration

Contrary to popular belief, exceeding the quota limit of your hosting provided isn’t that uncommon, especially if your website is rich in content. If that is indeed the case, you would want to delete some unused files on the server. 

Option 3 – Checking Temporary Folder

If the error still persists, you can be sure that the temporary folder of your WordPress site is filled to its maximum capacity. WordPress works by uploading your content to a temporary location on the server, and then proceeds to save this content in the Uploads folder. But if the temporary folder doesn’t have room itself, then there is no way for that content to reach the Uploads folder and Upload: Failed to Write File to Disk error occurs.

If this is the case, you will need to contact your hosting provider. If you are on VPS, here are instructions how to clean up disk space on VPS.

Conclusion

In this tutorial, we saw how to fix Upload: Failed to Write File to Disk WordPress error. The error can be caused by:

  • Incorrect file/folder permissions
  • Exceeding quota limit of web hosting provider
  • Overflow of the temporary folder

Hopefully, by following this guide, you were able to solve this error and continue saving media content on your WordPress website. 

Learn How to Solve Other WordPress Errors

How to Fix “Briefly Unavailable for Scheduled Maintenance” Error
How to Fix Missed Schedule Error in WordPress
How to Fix Mixed Content on WordPress
How to Fix Broken Links on WordPress
How to Solve 404 WordPress Error
How to Fix White Screen of Death on WordPress
How to Solve WordPress Not Sending Emails
How to Fix the Installation Failed: Destination Folder Already Exists Error

The author

Domantas G.

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

Why all in one WP migration is not importing?

The solution to the “stuck import” problem lies in taking another route towards getting your file into the All-in-One migration plugin. It relies on uploading your export file to a special folder in wp-content called ai1wm-backups and then using the “Backup” option to find the file and perform the restore.

How do I manually import all in one WP migration?

Step Two: Import to WordPress.com.
On your WordPress.com site, install and activate the All-in-One WP Migration plugin..
In the site's dashboard, go to All-in-One WP Migration → Import..
Click Import from and choose the File option..
Select the . ... .
Wait for the upload to complete..

How do I import all in one migration?

On your new WordPress site (the to one), select “Import” under the menu for “All in One WP Migration”. Drag the . wpress file you downloaded from your original site into the drag and drop window to start the import. Once the file has finished importing click “Continue”.

Why is all in one migration stuck?

Unfortunately, on some occasions, the migration process can get stuck during the export, or you will be unable to import. Mostly because of one of the following reasons: The free version doesn't allow to import for big backup files. Timeout issues.