Ffile2fix
Sign in Get started

How to fix "Failed to write file to disk" in WordPress

Failed to write file to disk.

This is PHP upload error 7 (UPLOAD_ERR_CANT_WRITE): PHP received the upload but could not save it to its temporary directory. It is almost always a full disk or quota, or a temp directory PHP cannot write to.

Also appears as: Upload failed: Failed to write file to disk. · UPLOAD_ERR_CANT_WRITE (PHP upload error 7) · The uploaded file could not be moved to wp-content/uploads/2026/10.

Common causes

  • The hosting account has reached its disk quota
  • The partition holding /tmp or upload_tmp_dir is full
  • The temp directory is not writable by the PHP user
  • Large local backups or cache folders filling the account
  • wp-content/uploads ownership changed after a migration (shows the 'could not be moved' variant)

How to fix it

  1. Check disk usage. In cPanel open Disk Usage; in hPanel check Hosting > Resources. On a VPS run df -h and look at both / and /tmp.
  2. Free up space. Remove old backup archives (e.g. wp-content/updraft, wp-content/ai1wm-backups), cache folders and unused themes. Move backups to off-site storage.
  3. Set a writable temp directory. Point upload_tmp_dir to a folder in your home directory (outside public_html) that your account owns, and set WP_TEMP_DIR to the same path.
  4. Check uploads permissions. wp-content/uploads and its year/month subfolders should be 755 and owned by the PHP user. Avoid 777.
  5. Retry with a smaller file. If small files work and large ones fail, the temp partition is nearly full or size-limited. Ask your host to check it.

SSH diagnostics

df -h /tmp ~
du -sh ~/public_html/wp-content/* | sort -h | tail
php -i | grep -E 'upload_tmp_dir|sys_temp_dir'
ls -ld ~/public_html/wp-content/uploads

How to stop it happening again

  • Store backups off-site instead of inside wp-content
  • Set up disk usage alerts in your hosting panel
  • Optimize images before upload to slow storage growth

Frequently asked questions

How is this different from 'Missing a temporary folder'?

Error 6 means the temp folder does not exist at all; error 7 means it exists but the write failed, usually because the disk is full or the folder is not writable.

My panel shows free space but uploads still fail. Why?

The account quota may be fine while the server's /tmp partition is full, or you may have hit the inode limit. Check both, or ask the host to check the server temp partition.

Do I need to change upload_max_filesize?

Not for this error. Size limits produce different messages; error 7 is about the server failing to write the file it already received.