Anyone knows a simple JavaScript library implementing the UNZIP algorithm? No disk-file access, only zip and unzip a string of values.
There are ActiveX, using WinZIP and other client dependent software for ZIP, written in JS. But no pure JavaScript algorithm implementation.
I would use it for displaying KMZ files in a HTML page with the GMap object (google maps). The KMZ file is just a zipped KML file. I want to unzip a KMZ file and feed the KML to GMap.
No need to unzip the KMZ file as Google Maps absolutely understands it. You can check it, simply search for the URL where your KMZ file is located in the Google Maps web interface and it will show its content on the map.
Here is a demo.
Perhaps ZipReader from Mozilla can be used for what you are after.
https://developer.mozilla.org/en/nsIZipReader
I know this is an old question with an accepted answer, but just for the sake of interesting information, I'll post another answer. I put together a javascript-only library to read and extract zip files from any browser. It does not require Mozilla's ZipReader nor any ActiveX (aside from XMLHttpRequest).
You can see a working example here:
http://cheeso.members.winisp.net/Unzip-Example.htm
And you can download the source code from here:
http://cheeso.members.winisp.net/examples.aspx#js
kthoom implements unzip on a binary string: http://kthoom.googlecode.com/
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