George Mauer
George Mauer

Reputation: 122212

Unzip a file with phonegap?

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.

Upvotes: 3

Views: 6290

Answers (3)

Oran Dennison
Oran Dennison

Reputation: 3297

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

Upvotes: 1

Simon MacDonald
Simon MacDonald

Reputation: 23273

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

Upvotes: 0

dda
dda

Reputation: 6213

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

More info: Unzipping files

Upvotes: 0

Related Questions