A compressed version of files, popularly known as zipped files are convenient but also prone to errors. So, when you attempt to open such files using freeware utilities like 7-Zip, you may encounter an error, saying Cannot open file as archive. Let us see what you can do about it.
Fix Cannot open file as archive error in 7-Zip
7-Zip is an excellent open-source file archiver. It can compress files within archives and read and write many other archive formats like ZIP, WIM, and GZIP. Sometimes, due to internet interruptions during file download or other problems, it may fail to open the file as an archive. Try these suggestions to fix the problem.
- Re-download or re-create the compressed archive file
- Use a ZIP Repair freeware
- Repair ZIP archive using WinRAR utility
- Use Command Prompt tool
- Check the Headers in Hex Editor.
The zip file format is one of the most popular forms of data storage. It is widely used for backup and transfer of information over the Internet. If you can’t open the file as an archive, do the following.
1] Re-download or re-create the compressed archive file
If you download the file, download it again to a different location and see. If you created it, re-create it again to a different location and see if it helps.
2] Use a ZIP Repair freeware
You can use one of these free software to repair corrupted and damaged compressed and zip files.
3] Repair ZIP archive using WinRAR utility
If it appears your ZIP file is corrupted then try to repair the corrupted ZIP archive using the WinRAR utility. The tool is equipped with a built-in repair feature that can repair corrupted RAR as well as the ZIP archive.
Launch the WinRAR tool, click on the File tab and select the Open option.
Then, under the Find Archive window, locate the corrupted ZIP file and select it.
Hit the Tools tab. Later, choose the Repair archive option.
Now, in the Repairing File name.ZIP window, click on the Browse button to select a location for the newly repaired ZIP archive.
Check the Treat the corrupt archive as ZIP box.
When done, hit the OK button to start the repairing process.
Upon completion, click Close to exit.
4] Run Command Prompt
If there’s an incorrect header at the start or end of the file, you will see this 7-Zip cannot open the file as an archive error message. You can try to repair the incorrect end header through Command Prompt. Here’s how!
Launch Command Prompt with Administrator privileges.
Type the following command and hit Enter –
“C:\Program Files\WinZip\wzzip” –yf zipfile.zip
(Make sure, you replace “zipfile.zip” with the name of your Zip file). The double quotes in the example above are necessary due to the space between “Program” and “Files”.
This will repair the file.
5] Check the Headers in Hex Editor
If you try to open or extract an archive and you see the message “Can not open file as archive“, it means that 7-Zip can’t open some header from the start or from the end of the archive. In that case, you must open the archive in a Hex Editor and look for the Start Header and End Header.
- If the start of the archive is corrupted, then there is no link to the End Header. But if the End Header is OK, and the size of the archive is also correct, you can replace data in Start Header in a hex editor with the following values:
0000000000: 37 7A BC AF 27 1C 00 04 00 00 00 00 00 00 00 00
0000000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Then try to open the archive, if you can open it and you see the list of files, try the Test or Extract command. - Start Header and End Header are OK, but the total size of the archive is not OK. You can calculate the correct size of the archive from values in the Start Header. Then you must recover the correct size. You can insert some data or remove some data somewhere in the archive.
What does Not a valid archive mean?
In simple language, not a valid archive means there’s some problem with the archive. It can happen either during copy or move operation or when part of the zip file becomes corrupt due to an interruption in download. This can be solved by discarding the damaged file and downloading a new copy.