I recently finished implementing the Large Merchant Services API and am using the downloadFile call to read Active Inventory Reports, and responses on bulk listing. My problem is that **sometimes** the ZIP file I get in the response cannot be decompressed. For example, I can run the script to download a new Active Inventory Reports file three times in a row, and two out of three times, the file will unzip just fine, and one out of three times it will fail. I have tried unzipping both in memory, programmatically, and saving the file to the drive and using an unzip utility. It just complains that the file is invalid. Due to the inconsistently this seems like something on eBay's end... is there anything special I need to know about the zip files that it sends?
Solution found - the 'bad' files had \r\n characters in the middle of the binary blob. My parsing was splitting on \r\n and thus dropping those from the middle of the zip blob. Most files do not have that character in them, strangely.
I still find this happening, and it seems to come in clusters. I am providing a link to the full response from an ActiveInventoryReport downloadFile request [here]. This is the raw response content (in binary). To extract the zip file, I get rid of everything up until the 'PK' characters on line 12, and then also remove the last MIME boundary at the very end of the file. This works most of the time, but sometimes it does not. [Here] is an example of the file above after the lines have been parsed out. It should be a valid zip archive, but is corrupt. :
While using zip files it may become corrupt due virus infection, software conflict crc error and many more. I too had faced the same problem and my zip file got corrupted. I tried many ways to repair the zip file as it contained many important documents. At last I was able to **repair and extract zip file** with the help of **[Zip File Repair Tool]**. I was able to recover all the documents in it. Most importantly this software is very user friendly. :