Common causes
- The download or upload was interrupted, so the end of the file (with the central directory) is missing
- The file is actually an HTML error page, a login page or another format saved with a .zip name
- The archive was transferred in FTP ASCII mode, which corrupts binary data
- The archive uses AES encryption, Deflate64, LZMA, Zstandard or ZIP64 that the built-in tool cannot handle
- It is one part of a split or multi-volume archive (.z01, .zip.001)
- Disk or storage errors damaged part of the file
How to fix it
- Compare the file size. Check the size against the source or the website listing. A smaller file means a partial download, so download it again, preferably with a download manager or curl -L -O.
- Check what the file really is. On Linux or macOS run file backup.zip, or open it in a text editor. A real ZIP starts with the characters PK; '<!DOCTYPE html>' means you saved a web page.
- Try a different extractor. Open it with 7-Zip on Windows or The Unarchiver/unzip on macOS. These handle ZIP64, AES and more compression methods than the built-in tools.
- Test the archive. Run unzip -t backup.zip or 7z t backup.zip to see which entries are damaged. If only some fail, extract the rest and re-fetch only what is missing.
- Join split archives first. If you have .z01/.z02 files or .zip.001 parts, keep them together and open the first part with 7-Zip, or merge with zip -s 0 split.zip --out whole.zip.
- Attempt recovery. For a damaged archive with no other copy, zip -FF backup.zip --out fixed.zip rebuilds the directory from local headers. Recovered files may still be incomplete, so verify them.
Terminal (Linux/macOS)
file backup.zip # should say: Zip archive data
unzip -t backup.zip # test every entry
zip -FF backup.zip --out fixed.zip # try to rebuild
unzip fixed.zip -d recovered/ How to stop it happening again
- Publish a SHA-256 checksum with archives and verify it after download
- Always use binary mode for FTP transfers
- Avoid creating archives with AES or exotic compression if recipients use built-in tools
- Test a backup archive with unzip -t right after creating it