October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Fix the WordPress “File Is Empty” Error on Media Uploads

WordPress’s empty-file upload error usually means PHP delivered a zero-byte temporary file or discarded the request. Follow this diagnostic sequence to check limits, permissions, storage, software conflicts, and MIME validation.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress shows “File is empty. Please upload something more substantial.” when its upload handler receives a zero-byte temporary file—or when PHP discards the upload before WordPress can read it. The fastest reliable fix is to check PHP request limits first, then the writable wp-content/uploads directory, available storage or multisite quota, logs, plugin and theme conflicts, and finally file-type validation.

What the “File is empty” message actually means

The message does not prove that the original photo, video, PDF, or other asset contains no data. WordPress checks the temporary file created for the HTTP upload. If that temporary file is zero bytes, core stops processing and returns “File is empty. Please upload something more substantial.” WordPress also identifies two configuration conditions that can produce the same result: uploads disabled in PHP, or post_max_size smaller than upload_max_filesize.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That distinction matters because the remedy depends on where the bytes disappeared. A genuinely empty local file needs to be replaced. A normal file that becomes empty during the request points to PHP limits, a rejected request, a failed temporary upload, storage exhaustion, or a server-side problem. Treat the message as an upload-path diagnostic, not as a verdict about the file on your computer.

Use the symptom to narrow the cause

What you observe Most useful first check Why it points there
Every file, including tiny images, fails Confirm PHP uploads are enabled and inspect the active PHP and web-server logs A global request or server failure is more likely than a size limit.
Only large files fail Compare the file size with upload_max_filesize and the complete request with post_max_size PHP can reject the request before WordPress receives usable file data.
The browser reaches the upload screen but the file is not saved Test write access and ownership on wp-content/uploads The PHP process may be unable to create or move the uploaded asset.
Uploads stopped after a period of normal operation Check disk space and, on multisite, the network upload quota A full filesystem or quota can block otherwise valid files.
Only one extension or MIME type fails Check WordPress file-type validation and the account’s upload capability Unsupported or misdetected types can be rejected independently of file size.
The problem disappears with plugins disabled or a default theme active Re-enable extensions one at a time while testing A plugin or theme can alter upload handling or filters.

This pattern is more useful than repeatedly retrying the same file. It tells you which layer to inspect without changing unrelated settings.

Before changing configuration, capture one controlled failure

  1. Use a small, known-good file whose size is comfortably below the site’s stated limits. Record its local size and extension.
  2. Retry once and note the exact time, the user account, the browser, and whether the failure affects the Media Library, the block editor, or another form.
  3. Review the PHP error log and the web-server error log for that request. Look for messages about request size, disabled uploads, temporary-file creation, permissions, disk space, or a fatal error.
  4. Do not make several unrelated changes at once. A single change followed by the same controlled retry preserves the evidence needed to identify the real cause.

Logs are especially important when the browser displays the generic WordPress message. They can show that PHP rejected the request before WordPress ran, which means changing a WordPress constant or reinstalling a plugin cannot fix that particular failure.

Step 1: Check PHP upload and request-size limits

Dashboard media uploads are processed by PHP. Three checks come first:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • file_uploads must be enabled.
  • upload_max_filesize must be large enough for the intended file.
  • post_max_size must be greater than or equal to upload_max_filesize, because it limits the complete HTTP request rather than just the file.

The request includes multipart form data and other fields, so choose limits that cover the largest file you actually need to accept. A limit that accommodates a 20 MB image may still reject a 25 MB video. Conversely, raising limits far beyond the site’s use case increases the amount of data a request can send and should be done deliberately.

Where to inspect the active values

Check the PHP configuration used by the web process, not only a command-line PHP installation. Depending on the host, the values may be visible in a hosting control panel, a PHP information page, or the server’s configuration files. A command-line value can differ from the PHP-FPM or Apache process that serves WordPress.

If you have administrative server access, an illustrative configuration is:

file_uploads = On
upload_max_filesize = 64M
post_max_size = 64M

The numbers above are an example, not a universal recommendation. Replace them with values appropriate for the site’s files and policy. After changing PHP configuration, reload or restart the relevant PHP service if the environment requires it, then confirm the active values from the web-facing PHP process. If a managed host controls these directives, ask support to verify the effective values and the request log rather than editing a file that the service does not read.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recognize a request rejected before WordPress

When post_max_size is too small, PHP can discard the request body before WordPress can inspect the uploaded file. WordPress then has no useful bytes to process and may report the same empty-file message. Increasing only upload_max_filesize is insufficient if the complete request still exceeds post_max_size. Keep the relationship between the two settings intact after every change.

Step 2: Check memory only after size limits

Memory is a separate constraint. WordPress documents a default WP_MEMORY_LIMIT of 40 MB and a default WP_MAX_MEMORY_LIMIT of 256 MB in its Advanced Administration Handbook. The latter applies to administrative requests and is therefore relevant to Media Library work, but memory changes do not turn a zero-byte request into a valid upload and do not repair a directory that PHP cannot write.

Use the logs to establish a memory exhaustion error before raising limits. If the log shows an allowed-memory-size failure during image processing, your host or WordPress configuration may need a higher limit that the server actually permits. Do not assume that adding a constant to wp-config.php overrides a lower PHP or hosting ceiling. Make one change, retry the controlled file, and keep the smallest value that resolves the documented error.

Step 3: Verify the uploads directory and permissions

WordPress normally stores media below wp-content/uploads, often in year-and-month subdirectories. The PHP process must be able to create directories and files there, and the resulting files must remain accessible for the site to serve them.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the configured path

Confirm that the site is using the expected uploads location and that the directory exists. A migration, manual relocation, or unusual configuration can leave WordPress pointing at a path that is missing or mounted read-only. Check the parent directories as well: write permission on a child directory is not useful if PHP cannot traverse its parents.

Check ownership before numeric modes

Inspect which operating-system user runs the web process and whether that user can write to the uploads path. Ownership should match the deployment model, such as the PHP-FPM pool user or the account used by the web server. If a deployment process created directories as a different user, correct ownership using the host’s documented method and then retest.

Use the least-permissive setting that permits the required operation. Making the entire WordPress tree world-writable with mode 777 is not a safe general fix: WordPress warns that overly permissive permissions can allow an attacker to upload or modify executable content. A permission change should target the affected directory and preserve the account and group boundaries used by the host.

Distinguish write failure from serving failure

A successful upload requires both storage and delivery. If a file is created but its URL returns an access error, investigate read and traversal permissions, web-server rules, and the configured uploads URL separately. If no file appears at all, concentrate first on PHP’s ability to create and move files and on the logs that describe that operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 4: Check disk space and multisite quotas

A valid request can fail when the filesystem has no room for the temporary file, the final media file, or image-size derivatives. Check free space on the volume used by PHP’s temporary files as well as the volume containing wp-content/uploads. A server can have free space on one mount and be full on another.

WordPress also checks remaining upload space and can set an error when a file exceeds the available quota. On multisite, inspect the network’s upload-space setting and the individual site’s remaining allocation. A site administrator may be able to upload small files while a larger file is refused because the quota is nearly exhausted. Free space on the server does not automatically increase a WordPress network quota.

After freeing space or increasing an authorized quota, retry the same controlled file. Avoid deleting random media to make room; identify old backups, logs, caches, or other approved data first, and verify that the upload volume—not merely the database volume—has capacity.

Step 5: Isolate plugins, themes, PHP compatibility, and core files

Test for a plugin or theme conflict

Temporarily deactivate plugins and switch to a default WordPress theme, then retry with the same file. If the upload succeeds, restore the normal theme and reactivate plugins one at a time, testing after each change. The first reactivated component after which the failure returns is a strong lead. Record the result rather than leaving unrelated plugins disabled on a production site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some extensions filter allowed MIME types, rewrite upload paths, process images, or add security checks. A conflict may affect every file or only a particular extension, so compare both a small image and the file type that originally failed.

Check PHP compatibility

Review the PHP version against the WordPress version and the active theme and plugins. An outdated extension, removed PHP behavior, or incompatible image-processing library can break an upload after an otherwise routine PHP upgrade. The exact fatal or warning in the PHP log is more useful than guessing from the WordPress message alone.

Repair suspected core-file damage carefully

If logs and conflict tests do not identify a cause, verify that WordPress core files are complete and unmodified except for intentional changes. Use the site’s normal update or repair procedure, keep a backup, and avoid overwriting custom content in wp-content. Core-file repair is appropriate when files are corrupted; it will not correct PHP limits, quota exhaustion, or ownership.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Step 6: Check file-type and MIME validation

WordPress validates the detected MIME type and blocks unsupported types unless the account has the unfiltered_upload capability. A file can therefore contain data and still fail because its extension, detected type, or account permissions do not satisfy the site’s policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare the failing file with a supported type such as a standard image. If only one type fails, check the site’s allowed MIME configuration and the account’s capabilities before changing server limits. Do not grant unrestricted uploads merely to bypass a warning; accepting executable or otherwise unsafe formats expands the site’s attack surface. If a file was renamed to disguise its type, obtain a correctly encoded copy instead of relying on the filename.

A complete, low-risk repair sequence

  1. Confirm the original file opens locally and is not actually zero bytes.
  2. Capture one failure and note the timestamp, account, file size, and exact message.
  3. Read PHP and web-server logs for request-size, disabled-upload, temporary-file, permission, storage, and fatal-error entries.
  4. Verify file_uploads, then set upload_max_filesize for the intended file and post_max_size to at least that value.
  5. Confirm the web-facing PHP process has adopted the values; reload the service if the environment requires it.
  6. Retry the controlled small file before testing the original large or unusual file.
  7. If limits are correct, verify the uploads path, ownership, write access, and read access without using 777.
  8. Check temporary-file storage, the uploads volume, and any multisite quota.
  9. Test with plugins disabled and a default theme, reintroducing components individually if the test succeeds.
  10. Investigate PHP compatibility or damaged core files when the logs point there.
  11. For a type-specific failure, review MIME validation and the account’s upload capability.

This order prevents a common mistake: raising memory or permissions when PHP discarded the request because its body exceeded post_max_size.

When to involve hosting support

Contact the host when you cannot inspect the PHP process used by the website, the directives are locked, logs are unavailable, or the temporary directory and uploads volume are managed outside your account. Give support the timestamp, affected file size, WordPress error text, and the result of your small-file test. Ask for the effective values of file_uploads, upload_max_filesize, and post_max_size, confirmation that the PHP worker can write to the configured uploads path, available space on both temporary and uploads volumes, and the matching server-log entry. Managed WordPress hosting can be useful specifically when PHP limits, directory ownership, quotas, and logs are controlled at the server level, but the smallest confirmed correction is still preferable to a blanket configuration change.

Final checklist

  • The local file contains data and is the type you intend to permit.
  • PHP uploads are enabled for the web-facing process.
  • upload_max_filesize covers the file.
  • post_max_size is greater than or equal to upload_max_filesize and covers the complete request.
  • Memory errors are confirmed in logs before memory limits are changed.
  • The PHP process can write to wp-content/uploads with least-privilege ownership and permissions.
  • The temporary and uploads volumes have capacity, and any multisite quota has room.
  • Plugin, theme, PHP compatibility, and core-file checks match the evidence in the logs.
  • MIME and capability checks explain any extension-specific failure.

The safest resolution is the smallest limit, ownership, quota, or software correction that makes the controlled retry succeed and is supported by the request logs. “File is empty” describes what WordPress received; finding where the bytes were lost is what fixes the upload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.