File uploaded with zero size (0 bytes): causes and how to fix it

Print
  • 0

A file that shows 0 bytes on the server after an upload was created, but its contents were never written. On a hosting account the most common reason is a full disk quota: the system can still add the file name, yet it has no room left for the data. Free up space or move to a larger plan, then upload the file again.

First check: is the disk full?

On the cPanel home page, the Statistics column on the right shows Disk Usage as used space against the plan limit. If the bar is at or near 100%, you have found the cause. Remember that e-mail lives on the same disk as the website, so a large mailbox can fill it as easily as the site files.

The same column may also show File Usage, the number of files (inodes). When that limit is reached, new files cannot be created at all; see Too many files (inodes) in your account. To find out which folders take the space, open Files, then Disk Usage (How to view disk usage information in cPanel).

Other causes worth checking

  • The quota of an additional FTP account. An FTP account can have its own upload limit, separate from the plan. Once it is used up, uploads through that account end empty even though the plan still has room. Raise it with Change Quota in FTP Accounts (How to create an additional FTP account).
  • An interrupted transfer. If the connection dropped mid-upload, the FTP program may leave an empty or truncated file behind. In FileZilla, look at the Failed transfers tab at the bottom of the window and start those files again.
  • A file saved while the disk was full. When a CMS or an editor rewrites a file without free space, the file can end up empty. If this hits wp-config.php or .htaccess, the site shows a blank page or an error 500.
  • Uploads through the website. If a file sent through a WordPress form or the media library fails, the PHP upload limit may be the reason, although this usually produces an error message rather than an empty file. See Changing PHP limits such as upload_max_filesize.

How to fix it

  1. Make room. Old plugin backups, leftover archives, large logs, cache and old mail are the usual candidates; Disk space running out: what you can safely delete goes through them one by one.
  2. Empty the File Manager trash (View Trash, then Empty Trash). Until you do, deleted files still count against the quota.
  3. Delete the empty copies on the server, or tell your FTP program to overwrite existing files, and upload them again.
  4. Check that no important file was emptied. In File Manager, click the Size column header to sort by size and look for 0-byte files in the site folder.
  5. If a configuration or site file was damaged, restore it from your own copy or from the daily backups: How to restore a website or specific files using JetBackup 5.

When you simply need more space

If the account is already tidy and still full, a bigger plan is the lasting solution. Log in to the client area, open Services, choose the hosting service and use Upgrade/Downgrade. The details are in Upgrading, downgrading or switching the billing cycle.

Questions clients ask

Is my file lost?

No. Only the copy on the server is empty; the original on your computer is untouched. Upload it again once there is space.

Why did the site break if I only uploaded images?

A full disk affects everything at once. While there is no space, the CMS cannot write its cache, sessions or settings, and a file it rewrites can be left empty.

Still getting empty files with free space available? Open a ticket at https://billing.tophost.md/submitticket.php, mention the file name, the folder and the program you used.

Was this answer helpful?