Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

Perhaps ZipReader from Mozilla can be used for what you are after.

https://developer.mozilla.org/en/nsIZipReader

DotNetZip has a COM interface, that can be accessed from Javascript. It has a stream-to-stream unzip capability, but I have never tried using that from Javascript.
Also I have never tried using the library in any way from within IE.

kthoom implements unzip on a binary string: http://kthoom.googlecode.com/

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top