{"id":27449,"date":"2021-07-28T17:00:16","date_gmt":"2021-07-28T15:00:16","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=27449"},"modified":"2021-07-27T12:14:00","modified_gmt":"2021-07-27T10:14:00","slug":"fix-failed-to-write-file-to-disk-error-wordpress","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/fix-failed-to-write-file-to-disk-error-wordpress\/","title":{"rendered":"How to Fix \u201cUpload: Failed to Write File to Disk\u201d Error in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Media files play a key role in the visual presentation of every WordPress website, and they can also affect its functionality. Their role in drawing in, engaging, and keeping visitors on a website cannot be overstated. This is why an error that prevents you from uploading new media files can draw your workflow to a halt.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we will discuss a file upload error called<em> Upload: Failed to Write File to Disk<\/em>. We\u2019ll cover the reasons why it may occur as well as the steps you should take to solve it. Fortunately, this error can be solved more easily than you might expect. There are a few troubleshooting methods you can use, and we\u2019ll cover them all below:[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#changing-the-file-permissions\">Changing the file permissions<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#emptying-the-wordpress-temporary-folder\">Emptying the WordPress temporary folder<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#checking-if-you-have-exceeded-your-storage-quota\">Checking if you have exceeded your storage quota<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">What causes the Upload: Failed to write file to disk error<\/h2>\n<p>[\/vc_column_text][vc_column_text]The <em>Upload: Failed to write file to disk<\/em> error happens when you try to upload media files to your WordPress installation. The specific error message you get varies depending on the source of the issue. Phrases like \u201cUnable to create directory wp-content\/uploads\/xxxx\/yy\u201d, \u201cWordPress has failed to upload\u201d, \u201cWordPress has failed to write\u201d, as well as some that mention a lack of disk space, are the most common.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There are several reasons why this error occurs. The most frequent one is having incorrect file permissions on your server. More precisely, if you set incorrect permissions for a folder, then you will be unable to modify it, i.e. write files to it. If that happens with your <em>uploads<\/em> folder, it means you won\u2019t be able to add any uploaded media files to it.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The easiest way of testing if this is the reason for the <em>Upload: Failed to write file to disk<\/em> error on your end is to navigate to Tools &gt; Site Health, and open the Info tab. If in the Filesystem Permissions, you see that the status of the <em>uploads<\/em> directory is set to <em>Not writable<\/em>, it means that incorrect permissions are causing the error.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"504\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Not-Writeable.jpg\" class=\"attachment-full size-full\" alt=\"Not Writeable\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Not-Writeable.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Not-Writeable-300x156.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Not-Writeable-768x399.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Not-Writeable-620x322.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Apart from that, this error can happen if you simply run out of disk space on the server. New media files get stored in a temporary file before being transferred to the <em>uploads<\/em> folder. A lack of space in the destination folder can stop the transfer process and result in the <em>Upload<\/em> error.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to fix the Upload: Failed to write file to disk error<\/h2>\n<p>[\/vc_column_text][vc_column_text]Now that you understand why the error occurs, let\u2019s examine the possible ways of solving it. We divided the troubleshooting process into three easily implemented steps, each addressing a potential reason for the error. With that being said, let\u2019s dive in.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"changing-the-file-permissions\"><\/a>Changing the file permissions<\/h3>\n<p>[\/vc_column_text][vc_column_text]As we mentioned, the most common reason for this error is that the permissions for your files and folders, especially on the folders that <a href=\"https:\/\/qodeinteractive.com\/magazine\/where-are-wordpress-images-stored\/\">store uploaded media files<\/a>, were not set properly. Therefore, the first troubleshooting step you should perform is to inspect the current permissions set for your files and folders <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-use-ftp\/\">using FTP<\/a>. Depending on what you find, you might need to change them.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To start, <strong>connect to your server<\/strong> using your FTP credentials and <strong>navigate to your root WordPress directory<\/strong>, often called public_html.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/12\/Public-HTML-FTP.jpg\" class=\"attachment-full size-full\" alt=\"Public HTML FTP\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/12\/Public-HTML-FTP.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/12\/Public-HTML-FTP-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/12\/Public-HTML-FTP-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/12\/Public-HTML-FTP-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, <strong>navigate to the wp-content directory<\/strong> and <strong>locate the <em>uploads<\/em> folder<\/strong> within. <strong>Right-click on the <em>uploads<\/em> folder<\/strong> and then<strong> select the<em> File Attributes\u2026<\/em> option<\/strong> from the dropdown menu.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"521\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/FTP-File-Attributes.jpg\" class=\"attachment-full size-full\" alt=\"FTP File Attributes\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/FTP-File-Attributes.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/FTP-File-Attributes-300x161.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/FTP-File-Attributes-768x413.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/FTP-File-Attributes-620x333.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will open a popup where you can set the permissions for the <em>uploads<\/em> folder, including all its files and subdirectories. The permission level for subdirectories should be set to 755 to make it possible to upload media files.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do this,<strong> insert 755 in the <em>Numeric Value<\/em> field<\/strong> within the popup screen. Then<strong> tick the checkbox next to the <em>Recurse into subdirectories<\/em> option<\/strong>. After that,<strong> select the <em>Apply to directories only<\/em> suboption<\/strong> and <strong>click on the <em>Ok<\/em> button<\/strong> to apply the selected permission level.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"521\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Change-File-Attributes.jpg\" class=\"attachment-full size-full\" alt=\"Change File Attributes\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Change-File-Attributes.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Change-File-Attributes-300x161.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Change-File-Attributes-768x413.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/07\/Change-File-Attributes-620x333.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]You will need to <strong>wait a bit<\/strong> for the selected permission level to be applied to all subdirectories within the <em>uploads<\/em> folder. Once that\u2019s done, your <em>uploads<\/em> folder will be writable and you should have no trouble uploading media files. <strong>Check if everything is working by trying to upload a media file.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>If you discover that you still have issues with uploading media files in WordPress, then you should check the permission levels above the <em>uploads<\/em> folder.<\/strong> More precisely, you should check if the file and folder permissions are properly set for all files and folders belonging to your WordPress website. The permissions should be set to 755 for folders and 644 for files. Please note, since the wp-config.php file is one of the crucial files in a WordPress installation, you should implement tighter permission levels for that particular file (use 440 or 400 instead of 644).[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you need further help with applying the necessary permission levels site-wide, we recommend taking a look at our article on <a href=\"https:\/\/qodeinteractive.com\/magazine\/set-file-and-folder-permissions-in-wordpress\/\">setting proper file and folder permissions in WordPress<\/a>. <strong>When you\u2019ve set everything, try to upload a media file once more to check if the error was resolved.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"emptying-the-wordpress-temporary-folder\"><\/a>Emptying the WordPress temporary folder<\/h3>\n<p>[\/vc_column_text][vc_column_text]If setting the file and folder permissions correctly hasn\u2019t fixed the error, it is time to explore some less obvious reasons for experiencing the <em>Upload: Failed to write file to disk<\/em> error. One possibility is that the temporary WordPress folder is full. WordPress tends to store uploaded content in a temporary folder on your server before saving it within the <em>uploads<\/em> folder. As such, if your temporary WordPress folder is already full, then new content can\u2019t be added to it. Then, that same content can\u2019t be placed within the uploads folder on the server, which results in you getting the upload error.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>In that case, to solve the error, you would need to empty the temporary folder used by WordPress.<\/strong> Unfortunately, that folder isn\u2019t accessible via FTP. Instead, you will need to <strong>consult your hosting provider regarding this matter.<\/strong> They will examine the content of that folder and empty it on your behalf. Once they give you the all-clear, you should check if the issue is still present by trying to upload some media files to your website.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"checking-if-you-have-exceeded-your-storage-quota\"><\/a>Checking if you have exceeded your storage quota<\/h3>\n<p>[\/vc_column_text][vc_column_text]Another reason why an <em>Upload: Failed to write file to disk<\/em> error can happen lies in reaching the storage limit provided by your hosting plan. This is a major concern for users who are on hosting plans with limited storage. Particularly because all the themes, plugins, and other WordPress website content can occupy a considerable amount of space.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>To verify if exceeding your hosting storage quota is the reason for the <em>Upload: Failed to Write File to Disk<\/em> error, you need to check your <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-check-wordpress-disk-usage\/\">WordPress disk usage<\/a>. If this turns out to be the source of the problem, you will need to either optimize your existing content to save some storage space or upgrade to a hosting plan with more space.<\/strong> In either case, you can consult your hosting provider on the best solution for you.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]As images and other media files are a crucial part of every WordPress website, getting an <em>Upload: Failed to Write File on Disk<\/em> error can be a pain. This error will hinder the editing process, stop the creation of new pieces of content, and affect your workflow as a whole.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Fortunately, this error can be easily solved by following the instructions we\u2019ve laid out in this article. The possible troubleshooting steps include setting the proper file and folder permissions, emptying the WordPress temporary folder, and increasing the hosting storage limit if it\u2019s been exceeded. These steps aren\u2019t difficult to implement, and we are confident you will be able to solve this error in a flash.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Uploading files such as images is crucial to making attractive content, that&#8217;s why you should learn how to fix a &#8220;failed to write file to disk&#8221; error.<\/p>\n","protected":false},"author":11229,"featured_media":27484,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[4,52,13],"class_list":["post-27449","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-tips","tag-troubleshooting","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/27449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=27449"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/27449\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/27484"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=27449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=27449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=27449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}