{"id":31557,"date":"2021-08-25T07:00:00","date_gmt":"2021-08-25T14:00:00","guid":{"rendered":"https:\/\/dhblog.dream.press\/blog\/?p=31557"},"modified":"2026-08-27T14:39:28","modified_gmt":"2026-08-27T21:39:28","slug":"how-to-fix-upload-failed-wordpress-error","status":"publish","type":"post","link":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/","title":{"rendered":"How to Fix the \u201cUpload: Failed to Write File to Disk\u201d Error in WordPress (3 Ways)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Are you encountering the \u201cUpload: Failed to write file to disk\u201d error message when uploading files in WordPress? Whether you\u2019re trying to add images or videos to your site, this message can be very frustrating, as it prevents you from sharing your amazing visuals with your audience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The \u201cUpload: Failed to write file to disk\u201d error is a server-side error: it means the web server cannot save your uploaded file to disk.<\/strong> In WordPress, three common causes are incorrect file permissions, a full or unavailable temporary directory on the server, and exhausted disk space on your hosting plan.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fortunately, you can troubleshoot this issue by following a few simple steps. In some cases, you\u2019ll just need to contact your web host to get it fixed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we\u2019ll take a closer look at the \u201cUpload: Failed to write file to disk\u201d error and its main causes. We\u2019ll then show you three simple ways to fix this problem. Let\u2019s get started!<\/p>\n\n\n\n<h2 id=\"h-what-causes-the-upload-failed-to-write-file-to-disk-error-in-wordpress\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">What does the \u201cUpload: Failed to write file to disk\u201d error mean in WordPress?<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In plain terms, the \u201cUpload: Failed to write file to disk\u201d error means the server-side PHP process handling your upload couldn\u2019t write the file to its destination on the server. It isn\u2019t unique to WordPress \u2014 any PHP-based upload can fail the same way \u2014 but in WordPress it typically appears when you\u2019re uploading media files. There are a few possible causes, the most common one being incorrect file permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every file and folder on your WordPress site comes with a set of permissions. These are controlled by the web server and determine which site users can access and edit your files and folders. The standard WordPress scheme is 755 for folders and 644 for files, per <span style=\"text-decoration: underline;\"><a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/server\/file-permissions\/\">WordPress\u2019s file permissions documentation<\/a><\/span>. If your uploads directory is set more restrictively, or its ownership is wrong, the server can\u2019t write new files there, and media uploads fail.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, this error could also be caused by a problem with the server\u2019s <span style=\"text-decoration: underline;\"><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/216735938--tmp-directory-overview\">temporary directory<\/a><\/span>, where PHP stages uploads. In fact, \u201cFailed to write file to disk\u201d is one of <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.php.net\/manual\/en\/features.file-upload.errors.php\">PHP\u2019s own documented upload error codes<\/a><\/span> (UPLOAD_ERR_CANT_WRITE), alongside \u201cMissing a temporary folder\u201d (UPLOAD_ERR_NO_TMP_DIR): if PHP can\u2019t write to its temporary directory, the upload fails. It\u2019s also possible that you\u2019ve reached the disk space limit provided with your hosting plan.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we\u2019ll take a closer look at these possible causes. We\u2019ll also walk you through a solution for each scenario.<\/p>\n\n\n\n\n\n<div\n\tclass=\"article-cta-shared article-cta-small\"\n>\n    <div class=\"tr-img-wrap-outer jsLoading\"><img decoding=\"async\" class=\"js-img-lazy \" src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/lazy-loading-transparent.webp\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder.webp 1x, https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder-x2.webp 2x\"  alt=\"Ad background image\" \/><\/div>\n\n\n\n\n  <div class=\"content-btm\">\n    <h2\n      class=\"h2--md\"\n    >\n      Skip the Stress\n    <\/h2>\n    <p\n      class=\"p--md\"\n    >\n      Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24\/7 to help solve website problems \u2014 big or small.\n    <\/p>\n\n            <a\n            href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\"\n                        class=\"btn btn--white-outline btn--sm btn--round\"\n                                    target=\"_blank\"\n            rel=\"noopener noreferrer\"\n            >\n                            Check Out Plans                    <\/a>\n\n  <\/div>\n<\/div>\n\n\n<h2 id=\"h-how-to-fix-the-upload-failed-to-write-file-to-disk-error-in-wordpress-3-ways\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">How to fix the \u201cUpload: Failed to write file to disk\u201d error in WordPress (3 ways)<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the three fixes, in the order we recommend trying them:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Correct your file permissions (755 for folders, 644 for files).<\/li>\n\n\n\n<li>Empty (or relocate) the WordPress temporary folder.<\/li>\n\n\n\n<li>Free up disk space or upgrade your hosting plan.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">As always, we recommend that you perform a <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-back-up-wordpress-tutorial\/\">backup of your site<\/a><\/span>&nbsp;before proceeding. That way, if something goes wrong, you can restore your site to an earlier version.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-change-the-file-permissions\"><span style=\"font-weight: bold;\">1. Change the file permissions<\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As we mentioned earlier, the \u201cUpload: Failed to write file to disk\u201d error is likely caused by incorrect file permissions. Before changing anything, you can confirm the diagnosis from inside WordPress: go to <span style=\"font-style: italic;\">Tools<\/span> &gt; <span style=\"font-style: italic;\">Site Health<\/span>, open the <span style=\"font-style: italic;\">Info<\/span> tab, and expand the <span style=\"font-style: italic;\">Filesystem Permissions<\/span> section. If your uploads directory shows \u201cNot writable,\u201d you\u2019ve found your culprit. To fix the permissions, you can contact your hosting provider and ask them to do it for you. Alternatively, you can do this yourself by accessing your site\u2019s root directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, you\u2019ll need to connect to your site via a <span style=\"text-decoration: underline;\"><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/115000675027-FTP-overview-and-credentials\">Secure File Transfer Protocol (SFTP) client<\/a><\/span>&nbsp;such as <span style=\"text-decoration: underline;\"><a href=\"https:\/\/filezilla-project.org\/\">FileZilla<\/a><\/span>. You can also access your site\u2019s directory through the file manager in your hosting account.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a DreamHost account, start by navigating to <span style=\"font-style: italic;\">Websites<\/span>&nbsp;&gt; <span style=\"font-style: italic;\">Files<\/span>&nbsp;in the sidebar. Then locate your domain and click on the <span style=\"font-style: italic;\">Manage Files <\/span>button.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/a89189d2-c5fc-47ab-9c4b-94e513bd4725_Upload-Failed-to-write-file-to-disk-DreamHost-7.jpg.webp\" alt=\"Accessing your site in DreamHost\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/395;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will take you to the file manager. To access your site\u2019s directory, you can open the folder labeled with your domain name. Inside, locate the <span style=\"font-style: italic;\">wp-content<\/span>&nbsp;folder and right-click on it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, select <span style=\"font-style: italic;\">File permissions<\/span>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/f31a8f14-44d1-49ad-b245-eebb9430a7a3_Upload-Failed-to-write-file-to-disk-DreamHost-1.jpg.webp\" alt=\"Locating the wp-content folder in your site\u2019s root directory.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 681px; --smush-placeholder-aspect-ratio: 681\/417;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the pop-up window, go to the <span style=\"font-style: italic;\">Numeric value<\/span>&nbsp;field and enter \u201c755\u201d in the corresponding box. (Permission needs can vary by host and server configuration, so confirm with your hosting provider if 755 doesn\u2019t resolve the issue.) Next, you can select the <span style=\"font-style: italic;\">Recurse into subdirectories<\/span>&nbsp;and <span style=\"font-style: italic;\">Apply to directories only <\/span>options&nbsp;and click on <span style=\"font-style: italic;\">OK<\/span>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/a45dca38-476d-4a6a-9346-16bf7e753f38_Upload-Failed-to-write-file-to-disk-DreamHost-5.jpg.webp\" alt=\"Changing the file permissions of your subdirectories in FileZilla.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/571;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You have now set the correct file permissions for all subdirectories inside the <span style=\"font-style: italic;\">wp-content <\/span>folder. This includes the <span style=\"font-style: italic;\">uploads<\/span>&nbsp;folder, which is where your uploaded media files are stored.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, you\u2019ll also need to set the correct permissions for the files within those folders. To do this, you can right-click on the <span style=\"font-style: italic;\">wp-content<\/span>&nbsp;folder again and select <span style=\"font-style: italic;\">File permissions<\/span>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <span style=\"font-style: italic;\">Numeric value<\/span>&nbsp;field, type in \u201c644\u201d. Then select the <span style=\"font-style: italic;\">Recurse into subdirectories<\/span>&nbsp;and <span style=\"font-style: italic;\">Apply to files only <\/span>options, and click on <span style=\"font-style: italic;\">OK<\/span>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/9baaf0a1-7679-4373-8da7-4af28c2407e9_Upload-Failed-to-write-file-to-disk-DreamHost-2.jpg.webp\" alt=\"Changing the file permissions of your files in FileZilla.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/608;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t worry if you\u2019re still unable to upload files to your site after checking your file permissions. There are a couple of other things you can do to resolve the issue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-empty-the-wordpress-temporary-folder\">2. Empty the WordPress temporary folder<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If changing the file permissions doesn\u2019t solve the problem, you may need to empty your temporary folder. WordPress processes your media uploads <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/update-php\/\">in PHP<\/a><\/span>. Per <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.php.net\/manual\/en\/features.file-upload.post-method.php\">PHP\u2019s documentation on POST method uploads<\/a><\/span>, uploaded files are stored by default in the server\u2019s temporary directory (the upload_tmp_dir location in php.ini) and are then moved to their final destination \u2014 in WordPress\u2019s case, your uploads folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the temporary folder is full, WordPress won\u2019t be able to write your files to disk until you\u2019ve emptied it. On web hosting plans, you typically can\u2019t reach the server\u2019s temporary directory over SFTP. However, you can simply <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/support\/\">contact your hosting provider<\/a><\/span>&nbsp;and ask them to empty the folder for you, and then check to see if the error has been resolved. On a VPS or dedicated server, a user with sudo or shell access can clear the temporary folder directly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can try to resolve this issue by defining a new location for WordPress to store your media (instead of the temporary folder). First, you\u2019ll need to connect to your site via an SFTP client or the file manager. Then locate the <span style=\"font-style: italic;\">wp-config.php<\/span>&nbsp;file, right-click on it, and select <span style=\"font-style: italic;\">View\/Edit<\/span>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/05b83eec-8c4b-4cc4-a2bb-9a7fc86d9230_Upload-Failed-to-write-file-to-disk-DreamHost-8.jpg.webp\" alt=\"Editing the wp-config.php file in FileZilla.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/564;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you\u2019ll need to paste in <span style=\"text-decoration: underline;\"><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/get_temp_dir\/\">the following code<\/a><\/span>&nbsp;right before the line that reads \u201cThat\u2019s all, stop editing! Happy publishing\u201d:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-style: italic;\">define(&#8216;WP_TEMP_DIR&#8217;, dirname(__FILE__) . &#8216;\/wp-content\/temp\/&#8217;);<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save your changes, then navigate to the <span style=\"font-style: italic;\">wp-content<\/span>&nbsp;folder, open it, and create a new folder inside it called <span style=\"font-style: italic;\">temp<\/span>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2021\/08\/a1a6311d-07ac-47c7-8c85-7dc807a2c7b1_Upload-Failed-to-write-file-to-disk-DreamHost-9.jpg.webp\" alt=\"Creating a temp folder inside the wp-content folder.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/563;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you\u2019re done, you can return to your website and try to upload an image. If the file disk error was caused by the temporary folder, the issue should now be resolved.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-upgrade-your-hosting-plan\"><span style=\"font-weight: bold;\">3. Free up disk space or upgrade your hosting plan<\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The disk error could also be a sign that you\u2019ve outgrown your current hosting plan. For example, if you\u2019ve been adding a lot of content to your site, including media files, new pages, and plugins, you might have used up all the disk space available in your account.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your web host may be able to tell you how much disk space you have left. If you\u2019re a DreamHost client, you can check your storage usage by logging into your hosting account and opening the <span style=\"font-style: italic;\">Servers &amp; Usage<\/span> page, which displays CPU, RAM, and storage usage for your Web Hosting plan in visual graphs. You can also click the <span style=\"font-style: italic;\">View Disk Usage<\/span> link under <span style=\"font-style: italic;\">Other Active Services<\/span> on the Manage Account page.<\/p>\n\n\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re near your limit, free up the space you already have before paying for more. Delete old backup archives that plugins have stored on the server, remove unused plugins and themes, clear built-up caches, rotate or delete old log files, and compress oversized images. DreamHost\u2019s <span style=\"text-decoration: underline;\"><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/16359909749396-Disk-usage-best-practices\">disk usage best practices<\/a><\/span> guide walks through each of these steps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If cleanup doesn\u2019t get you comfortably under your limit, your site legitimately needs more ongoing storage, and it might be time to <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/web-hosting-guide\/\">upgrade to a more advanced hosting plan<\/a><\/span>. This will give your site more room to grow. Compare your current storage cap and usage against what each candidate plan lists, and choose one with meaningfully more space. For a WordPress site that also wants hands-off management, <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\">DreamPress<\/a><\/span>, DreamHost\u2019s managed WordPress hosting, is worth weighing, but choose it for the managed features rather than storage alone: DreamHost\u2019s <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/hosting\/web-hosting\/\">Web Hosting<\/a><\/span> tiers reach 100 GB, more than the smaller DreamPress plans, and each plan\u2019s storage and current pricing are listed on its page.<\/p>\n\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-stop-the-error-from-coming-back\"><span style=\"font-weight: bold;\">How to stop the error from coming back<\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the error keeps returning, one of three things is usually drifting. Disk usage may be climbing again (check the Servers &amp; Usage page), the temporary directory may be filling up (ask your host to confirm and clear it), or your file permissions may be changing (re-run the Site Health check under <span style=\"font-style: italic;\">Tools<\/span> &gt; <span style=\"font-style: italic;\">Site Health<\/span> &gt; <span style=\"font-style: italic;\">Info<\/span>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Prevention is mostly housekeeping. Store backups off-server instead of in your hosting account, and make the cleanup steps from fix #3 (images, logs, caches, unused plugins and themes) a regular habit rather than a one-time rescue.<\/p>\n\n\n<div class=\"single__related-article\">\n\t<span>Related Article<\/span>\n\t<div class=\"single__related-article__wrap\">\n\t\t<div class=\"single__related-article__title\">\n\t\t\tWordPress Plugin Development: Build Your First Plugin By Hand Or With AI\n\t\t<\/div>\n\t\t<a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-create-your-first-wordpress-plugin\/\" class=\"btn btn--sm btn--brand\" target=\"_blank\" rel=\"noopener\">\n\t\t\tRead More\n\t\t<\/a>\n\t<\/div>\n<\/div>\n\n\n<h2 id=\"h-additional-wordpress-error-articles\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">Additional WordPress error articles<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do you want to learn how to resolve other technical issues on your site? We\u2019ve put together several tutorials to help you troubleshoot the most <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/common-wordpress-errors\/\">common WordPress errors<\/a><\/span>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/troubleshooting-wordpress-white-screen-death\/\">How to Troubleshoot the WordPress White Screen of Death<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/common-wordpress-errors\/\">How to Fix the 500 Internal Server Error in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-syntax-errors-wordpress\/\">How to Fix Syntax Errors in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-not-sending-email\/\">How to Fix the WordPress Not Sending Email Issue<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/360021570592-Error-establishing-a-database-connection\">How to Fix the Error Establishing a Database Connection<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-404-error\/\">How to Fix WordPress Error 404 Not Found<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-white-text-missing-buttons-wordpress\/\">How to Fix White Text and Missing Buttons in WordPress Visual Editor<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/wordpress-sidebar-below-content-error\/\">How to Fix the Sidebar Below Content Error in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/what-to-do-when-locked-out-wordpress\/\">What to Do When You\u2019re Locked Out of the WordPress Admin Area<\/a><\/span><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re looking for more information about running a WordPress site, make sure to check out <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/category\/wordpress\/\">our WordPress Tutorials<\/a><\/span>. This is a collection of guides designed to help you navigate the <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-keeps-logging-out-error\/\">WordPress dashboard<\/a> like an expert.<\/p>\n\n\n\n<div class=\"article-newsletter article-newsletter--gradient\">\n\n\n<h2>Get Content Delivered Straight to Your Inbox<\/h2><p>Subscribe now to receive all the latest updates, delivered directly to your inbox.<\/p><form class=\"nwsl-form\" id=\"newsletter_block_\" novalidate><div class=\"messages\"><\/div><div class=\"form-group\"><label for=\"input_newsletter_block_\"><input type=\"email\"name=\"email\"id=\"input_newsletter_block_\"placeholder=\"Enter your email address\"novalidatedisabled=\"disabled\"\/><\/label><button type=\"submit\"class=\"btn btn--brand\"disabled=\"disabled\"><span>Sign Me Up!<\/span><svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M13.8523 0.42524L12.9323 1.34521C12.7095 1.56801 12.7132 1.9304 12.9404 2.14865L16.7241 5.7823H0.5625C0.251859 5.7823 0 6.03416 0 6.3448V7.6573C0 7.96794 0.251859 8.2198 0.5625 8.2198H16.7241L12.9405 11.8535C12.7132 12.0717 12.7095 12.4341 12.9323 12.6569L13.8523 13.5769C14.072 13.7965 14.4281 13.7965 14.6478 13.5769L20.8259 7.39879C21.0456 7.17913 21.0456 6.82298 20.8259 6.60327L14.6477 0.42524C14.4281 0.205584 14.0719 0.205584 13.8523 0.42524Z\" fill=\"white\"\/>\n<\/svg>\n<\/button><\/div><\/form><\/div>\n\n\n<h2 id=\"h-failed-to-write-file-to-disk-faqs\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">\u201cFailed to write file to disk\u201d FAQs<\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-is-the-failed-to-write-file-to-disk-error-server-side\">Is the \u201cfailed to write file to disk\u201d error server-side?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The error comes from the server, not your browser or computer: the server-side process handling the upload couldn\u2019t write the file to disk. That\u2019s why every fix (permissions, the temporary folder, disk space) happens on the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-does-the-error-mean-the-server-cannot-save-my-file\">Does the error mean the server cannot save my file?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Exactly. WordPress received your upload, but the web server was unable to save it to its destination folder. The file won\u2019t reach your media library until the underlying cause is fixed \u2014 most often incorrect file permissions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-role-does-php-play-in-this-upload-error\">What role does PHP play in this upload error?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress processes uploads in PHP. Your file is first stored in the server\u2019s temporary directory before being moved to the uploads folder, so a full temporary directory can trigger the error even when your file permissions are correct.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-do-i-empty-the-wordpress-temporary-folder\">How do I empty the WordPress temporary folder?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On web hosting plans, you typically can\u2019t reach the server\u2019s temporary directory yourself, so ask your host\u2019s support team to clear it. Alternatively, define the WP_TEMP_DIR constant in wp-config.php to move the temporary folder somewhere you can manage.<\/p>\n\n\n\n<h2 id=\"h-fix-the-upload-failed-to-write-file-to-disk-error\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">Fix the \u201cUpload: Failed to write file to disk\u201d error<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The \u201cUpload: Failed to write file to disk\u201d error message prevents you from uploading files such as images and videos to your WordPress site. Incorrect file permissions on your site normally cause this error. However, you may also be seeing this message because you\u2019ve used all the disk space offered with your hosting plan.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we looked at three simple ways to fix this common WordPress error:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Change the file permissions of your WordPress site using an SFTP client like <span style=\"text-decoration: underline;\"><a href=\"https:\/\/filezilla-project.org\/\">FileZilla<\/a><\/span>.<\/li>\n\n\n\n<li>Empty the WordPress temporary folder through your web host, or relocate it with the WP_TEMP_DIR constant in wp-config.php.<\/li>\n\n\n\n<li>Free up disk space by clearing old backups, logs, and caches, or upgrade your hosting plan for more storage.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019d rather never troubleshoot this yourself, <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\">DreamPress<\/a><\/span> plans include 24\/7 support from in-house WordPress experts. DreamPress is DreamHost\u2019s managed WordPress hosting, and it makes it easy to move up to a larger plan as your site grows.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Are you encountering the \u201cUpload: Failed to write file to disk\u201d error message when uploading files in WordPress? Whether you\u2019re trying to add images or videos to your site, this message can be very frustrating, as it prevents you from sharing your amazing visuals with your audience. The \u201cUpload: Failed to write file to disk\u201d [&hellip;]<\/p>\n","protected":false},"author":1062,"featured_media":86859,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_yoast_wpseo_opengraph-title":"Failed to Write File to Disk (WordPress Fix) - DreamHost","_yoast_wpseo_opengraph-description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","_yoast_wpseo_twitter-title":"Failed to Write File to Disk (WordPress Fix) - DreamHost","_yoast_wpseo_twitter-description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","toc_headlines":"[[\"h-what-causes-the-upload-failed-to-write-file-to-disk-error-in-wordpress\",\"What does the \u201cUpload: Failed to write file to disk\u201d error mean in WordPress?\"],[\"h-how-to-fix-the-upload-failed-to-write-file-to-disk-error-in-wordpress-3-ways\",\"How to fix the \u201cUpload: Failed to write file to disk\u201d error in WordPress (3 ways)\"],[\"h-additional-wordpress-error-articles\",\"Additional WordPress error articles\"],[\"h-failed-to-write-file-to-disk-faqs\",\"\u201cFailed to write file to disk\u201d FAQs\"],[\"h-fix-the-upload-failed-to-write-file-to-disk-error\",\"Fix the \u201cUpload: Failed to write file to disk\u201d error\"]]","hide_toc":false,"show_updated_at":"1","footnotes":""},"categories":[6406,13127,550,696],"tags":[],"class_list":["post-31557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dreampress","category-errors-troubleshooting","category-tutorials","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Failed to Write File to Disk (WordPress Fix) - DreamHost<\/title>\n<meta name=\"description\" content=\"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Failed to Write File to Disk (WordPress Fix) - DreamHost\" \/>\n<meta property=\"og:description\" content=\"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DreamHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-25T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-27T21:39:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jason Cosper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Failed to Write File to Disk (WordPress Fix) - DreamHost\" \/>\n<meta name=\"twitter:description\" content=\"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.\" \/>\n<meta name=\"twitter:creator\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:site\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jason Cosper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Failed to Write File to Disk (WordPress Fix) - DreamHost","description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/","og_locale":"en_US","og_type":"article","og_title":"Failed to Write File to Disk (WordPress Fix) - DreamHost","og_description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","og_url":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/","og_site_name":"DreamHost Blog","article_publisher":"https:\/\/www.facebook.com\/DreamHost\/","article_published_time":"2021-08-25T14:00:00+00:00","article_modified_time":"2026-08-27T21:39:28+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp","type":"image\/webp"}],"author":"Jason Cosper","twitter_card":"summary_large_image","twitter_title":"Failed to Write File to Disk (WordPress Fix) - DreamHost","twitter_description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","twitter_creator":"@dreamhost","twitter_site":"@dreamhost","twitter_misc":{"Written by":"Jason Cosper","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#article","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/"},"author":{"name":"Jason Cosper","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/696d1ca9f2e23c846e02e04944e8fca4"},"headline":"How to Fix the \u201cUpload: Failed to Write File to Disk\u201d Error in WordPress (3 Ways)","datePublished":"2021-08-25T14:00:00+00:00","dateModified":"2026-08-27T21:39:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/"},"wordCount":2140,"publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp","articleSection":["DreamPress","Errors &amp; Troubleshooting","Tutorials","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/","url":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/","name":"Failed to Write File to Disk (WordPress Fix) - DreamHost","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#primaryimage"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp","datePublished":"2021-08-25T14:00:00+00:00","dateModified":"2026-08-27T21:39:28+00:00","description":"Failed to write file to disk in WordPress? Learn why this server-side error happens and fix it with three simple troubleshooting steps.","breadcrumb":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#primaryimage","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-upload-failed-wordpress-error-dreamops-ea22ecd1448c66e0b237b06a.webp","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-upload-failed-wordpress-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Fix the \u201cUpload: Failed to Write File to Disk\u201d Error in WordPress (3 Ways)"}]},{"@type":"WebSite","@id":"https:\/\/www.dreamhost.com\/blog\/#website","url":"https:\/\/www.dreamhost.com\/blog\/","name":"DreamHost Blog","description":"","publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dreamhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dreamhost.com\/blog\/#organization","name":"DreamHost","url":"https:\/\/www.dreamhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","contentUrl":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","width":1200,"height":168,"caption":"DreamHost"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DreamHost\/","https:\/\/x.com\/dreamhost","https:\/\/www.instagram.com\/dreamhost\/","https:\/\/www.linkedin.com\/company\/dreamhost\/","https:\/\/www.youtube.com\/user\/dreamhostusa"]},{"@type":"Person","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/696d1ca9f2e23c846e02e04944e8fca4","name":"Jason Cosper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","caption":"Jason Cosper"},"description":"Jason is DreamHost\u2019s WordPress Product Advocate, based out of Bakersfield, CA. He is currently working on making our DreamPress product even better. In his free time, he likes to curl up on the couch and watch scary movies with his wife Sarah and three very small dogs. Follow him on Twitter.","url":"https:\/\/www.dreamhost.com\/blog\/author\/jasoncosper\/"}]}},"lang":"en","translations":{"en":31557,"es":31571,"de":52330,"ru":53813,"pt":53837,"uk":53855,"pl":53879,"it":68987,"fr":71607,"nl":71651},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/31557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/users\/1062"}],"version-history":[{"count":2,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/31557\/revisions"}],"predecessor-version":[{"id":91441,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/31557\/revisions\/91441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media\/86859"}],"wp:attachment":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media?parent=31557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/categories?post=31557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/tags?post=31557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}