Open davemerrill opened 6 years ago
Nevermind, this works perfectly:
pako.inflate(binaryData, { to: 'string' })
Doesn't work for me... could you explain how you derive "binaryData"? Thanks, (Cannot find a way to inflate (decompress) a zip file made with jszip).
I have JSON files with a base64 encoded JSON string in zip format inside them. I need that inner JSON object, in a browser. Java's InflatorInputStream can unpack it on the server, so it actually is in zip format.
However, trying to decompress it with JSZip gives "Uncaught (in promise) Error: Can't find end of central directory : is this a zip file ?". I'm not sure I understand that error, but the obvious explanation is that it's not a compressed file system, just a compressed string.
Can JSZip inflate that? How?
Here's what I tried, with an empty promise handler:
new JSZip().loadAsync(binaryData).then(function(zip) {});