Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unzip strings in javascript [closed]

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.

like image 504
Trident Splash Avatar asked May 23 '09 19:05

Trident Splash


4 Answers

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.

like image 199
viam0Zah Avatar answered Oct 11 '22 21:10

viam0Zah


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

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

like image 42
mr-euro Avatar answered Oct 11 '22 20:10

mr-euro


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

like image 34
Cheeso Avatar answered Oct 11 '22 20:10

Cheeso


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

like image 34
codedread Avatar answered Oct 11 '22 22:10

codedread