sfw/fix
Write to Disk high

Upload: Failed to Write File to Disk

WordPress accepted the file but couldn't save it to wp-content/uploads, almost always a permissions, disk-space, or PHP temp-dir problem.

What you see

"filename.jpg" has failed to upload. Upload: failed to write file to disk.

What’s actually happening

You drag an image into the Media Library or a post and it fails right at the end. Every file fails the same way regardless of size or type. The Site Health screen may flag the uploads directory as not writable. New media can't be added at all, which also blocks featured images and most page-builder uploads.

Common causes

  • Wrong ownership or permissions on wp-content/uploads — the web server's user (www-data, apache, nobody) can't write there. Often happens after a migration or a manual chmod gone wrong.
  • The disk or hosting quota is full. PHP literally has nowhere to put the bytes. Check this first if it started suddenly with no config changes.
  • PHP's temp directory (upload_tmp_dir / sys_temp_dir) is missing, unwritable, or full. Uploads land in temp before WordPress moves them, so if temp is broken the move fails.
  • open_basedir restrictions on the host block writes to the temp path PHP is configured to use.
  • The account hit its inode limit (too many files) even though the byte quota looks fine — common on cheap shared hosting.

How to fix it

  1. Check free disk space and inodes before anything elseSSH in and run df -h for bytes and df -i for inodes. On cPanel, look at the disk usage gauge. If either is at 100%, that's your answer — clear old backups, logs, or cache files. No permission change will help a full disk.
  2. Set the uploads directory to 755 and fix ownershipOver SSH: find wp-content/uploads -type d -exec chmod 755 {} \; and find wp-content/uploads -type f -exec chmod 644 {} \;. Folders 755, files 644. Then make sure the web user owns it, e.g. chown -R www-data:www-data wp-content/uploads (the user varies by host). Wrong ownership is the most common single cause.
  3. Point PHP at a writable temp directoryIf df shows space but writes still fail, PHP's temp dir is likely the problem. Add upload_tmp_dir = /home/youruser/tmp to php.ini (create that folder, chmod 755), or as a quick test add define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/'); to wp-config.php after creating wp-content/temp. Restart PHP-FPM.
  4. Confirm the uploads path setting is saneGo to Settings > Media. If "Store uploads in this folder" points somewhere that doesn't exist, fix it or blank it to use the default wp-content/uploads. A bad value here from an old migration produces this exact error.
  5. Ask the host to lift open_basedir restrictionsOn locked-down shared hosting, open_basedir may block the temp path. If everything above checks out and writes still fail, send the host the full error and ask them to confirm the PHP temp directory is within the allowed open_basedir paths.

Stop it recurring

Keep directories at 755 / files at 644, owned by the web server user, and monitor disk and inode usage so uploads never hit a full volume.

Related errors