Does anyone have any ideas for how to pragmatically quickly check if a zip file is corrupted based on file size? Ideally the best way to check if a zip is corrupted is to do a CRC check but this can take a long time especially if there is a lot of large zip files. I would be happy just to be able to do a quick file size or header check.
Thanks in advance.
Section 4.3.7 of this page says that the compressed size is 4 bytes starting from byte 18. You could try reading that and comparing it to the size to the file.
However, I think it's pretty much useless for checking if the zip file is corrupted for two reasons:
So, I suggest calculating the CRC for a guaranteed method of checking for corruption.