Common causes
- An incomplete download or upload that cut off the end of the file
- curl or wget saved a redirect, 403/404 page or login page instead of the archive
- The file is a different format (tar.gz, 7z, RAR) with a .zip extension
- It is one volume of a split archive (backup.z01, backup.z02, backup.zip)
- The archive is still being written by another process or a backup job that failed
- An archive over 4 GB was created by a tool without proper ZIP64 support
How to fix it
- Identify the file type. Run file backup.zip and head -c 100 backup.zip. HTML, JSON or 'gzip compressed data' means it is not a ZIP and needs a different tool or a proper download.
- Download with redirects followed. Use curl -fL -o backup.zip URL or wget URL. Without -L, curl saves a redirect response, and without -f it saves error pages as if they were the file.
- Check size and checksum. Compare ls -l backup.zip with the expected size and run sha256sum backup.zip against the published hash. A mismatch means fetch the file again.
- Merge split volumes. Put all parts in one folder and run zip -s 0 backup.zip --out single.zip, then unzip single.zip. For .zip.001 style parts use cat backup.zip.0* > backup.zip or 7-Zip.
- Rebuild the central directory. If the file is a truncated ZIP, run zip -FF backup.zip --out fixed.zip to scan local headers. Files cut off at the end will be missing or damaged.
- Use 7-Zip for large archives. For archives over 4 GB, try 7z x backup.zip, which handles ZIP64 well. Older unzip builds without ZIP64 support may fail on valid large archives.
Terminal
file backup.zip
curl -fL -o backup.zip https://example.com/backup.zip
sha256sum backup.zip
zip -s 0 backup.zip --out single.zip # join split parts
zip -FF backup.zip --out fixed.zip # rebuild truncated ZIP How to stop it happening again
- Use curl -fL or wget so failed downloads are not saved as files
- Verify archives with unzip -t or a checksum before deleting the source
- Do not move or download a backup until the job that writes it has finished
- Keep all parts of split archives together