WordPress media upload fails (HTTP error / failed to write file / unable to create directory): how to fix
- 20.02.2026 00:58
-
- file management
- performance
- troubleshooting
- wordpress
If WordPress cannot upload images or files, you may see messages like:
- HTTP error
- Unable to create directory
wp-content/uploads - Failed to write file to disk
- The uploaded file exceeds the
upload_max_filesizedirective
On GARMTECH Hosting, these issues are usually caused by permissions, lack of disk space/quota, or PHP upload limits.
Step 1 – Check hosting disk space / quota
- In Plesk, check your subscription/disk usage (or the plan limits).
- If disk space is full, delete old backups/logs or unused files, then retry the upload.
Step 2 – Verify the uploads folder exists
- Open Plesk → your domain → Files.
- Go to
httpdocs/wp-content/. - Make sure the folder
uploadsexists. If it does not exist, create it:wp-content/uploads.
Step 3 – Fix permissions (do not use 777)
WordPress needs write access to wp-content/uploads.
- Recommended permissions on shared hosting are usually
755for folders and644for files.
In Plesk File Manager:
- Select the
uploadsfolder. - Choose Change Permissions.
- Set permissions to
755, and apply to subfolders if needed.
Step 4 – Increase PHP upload limits (if the file is large)
- In Plesk, open PHP Settings for the domain.
- Increase, within your plan limits:
upload_max_filesizepost_max_size(must be larger thanupload_max_filesize)memory_limitmax_execution_time(for slow connections or large processing)
Step 5 – Check WordPress image processing and plugins
- Temporarily disable security/caching plugins and try again.
- If the issue happens only with specific file types, a security rule may be blocking them.
Step 6 – Review logs for the exact error
- In Plesk, open Logs for the domain and retry the upload to capture the error.
- Also check WordPress Site Health and any plugin logs.
Common quick fixes
- Rename the file to remove special characters (use
photo-01.jpginstead of spaces/symbols). - Try a smaller file to see if it’s a size/limit issue.
- Update WordPress core/plugins/themes if they are outdated.
Related Articles
Comments
Add Comment