3

I have a phonegap application which will need to take a zip archive of a webpage, unzip it, and display the output.

I have been looking around for ways to zip/unzip with phonegap and have been coming up short. Since it's all Js it seems like JsZip might hold an answer but their test suite has nothing on unzipping.

Does anyone have any advice on how to achieve this?

Edit for posterity: I DID ultimately get javascript unzipping working with zip.js and a bunch of wrapper code. It worked fine but is quite processor intensive. Unzipping a 15mb zip file in chrome on a desktop took about 40 seconds. For anything where performance is a concern (most things), I would recommend stepping down a level and using a component directly from ios/android.

George Mauer
  • 117,483
  • 131
  • 382
  • 612
  • 1
    Hi George!! Did you finally get this to work?? Because it seems there's a plugin for this task (https://github.com/filmaj/Hydra/tree/master/ext/iOS/plugins/ZipUtil), but not documentation yet. So instead of figuring out how to use it, I'd go for this approach as long as it works in iOS – davids Jul 11 '12 at 08:02
  • Curse you @GeorgeMauer! I was looking for how to actually doing it with the Obj-C since your JS way takes FOREVER and stumbled upon this post. (For those unaware (so, everyone), George and I are working on the same project, or I should say George dumped it off on me.) – CWSpear Jan 09 '13 at 18:25
  • 1
    http://stackoverflow.com/questions/17439837/unzip-plugin-for-phonegap-2-3-or-higher-in-android plz see the question – Ashisha Nautiyal Jan 02 '14 at 12:34
  • Very nice @AshishNautiyal I assume this preforms a lot better than all-javascript? – George Mauer Jan 02 '14 at 16:11

3 Answers3

1

cordova-plugin-zip worked for me. It supports native unzipping for iOS and Android. https://github.com/MobileChromeApps/cordova-plugin-zip

Oran Dennison
  • 3,237
  • 1
  • 29
  • 37
0

See this one: http://cheeso.members.winisp.net/Unzip-Example.htm

More info: Unzipping files

Community
  • 1
  • 1
dda
  • 6,030
  • 2
  • 25
  • 34
0

If the JavaScript approach does not work you can always just write a Plugin.

Simon MacDonald
  • 23,253
  • 5
  • 58
  • 74