I have previously been using Chilkat Zip .Net to generate backup files from my application, but after having issues with the Component, moved to Xceed Zip .Net for the same function.
If you take one of the Zips generated with the Chilkat and attempt to extract using Xceed, 7Zip, WinZip then it fails.
If you take the same file and extract with Chilkat, Windows Zip, WinRar then the file extracts just fine.
Having a read on Wikipedia about the WinZip format I investigated the Central Directory and the Local File header, and it appears that the Chilkat component has written the Central Directory record filesize incorrectly. If you use something like FRHed to edit the Central Record and make the filesize the same as the Local Header size, then everything extracts correctly.
What would you recommend I do?
Step 1 Launch File Repair Tool and select the "Repair ZIP File" option start to repairing the process. Step 2 Search corrupt ZIP file in local drive and select the specific corrupt ZIP files. Step 3 All corrupt ZIP files list in the result section and click the "Repair" button.
There are various reasons for a zip file corruption. Incomplete download of a zip file from a website, viruses, file system errors, removable media corruption are some of the causes of zip corruption.
It depends on number of backups your program generated. Probably, it would be easier to decompress/recompress them from program or by hands. However, if there is a lot of files, the better way would be to fix central directory record fields - you should write code, which 1) searches for central directory; 2) for each record, goes to position where local file header is stored, and read file size; 3) go back to central directory and write valid file size there; 4) Beware of large files, if they are - file size for files >4Gb is written in extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With