0.0.9 • Published 9 years ago
eszip v0.0.9
es-zip
Cordova plugin to provide zip functionality on hybrid applications, such as on those made with Ionic framework. The Java code is mostly borrowed from StackOverflow and so, I've done preprocessing in Javascript. Change it as it may suit you.
Why was this plugin needed?
The official cordova plugin for zipping failed for me, resulting in bad zip. I tried to debug it but couldn't so I thought why not make a simpler one which gaurantees solution.
Getting started
Install the plugin by using following command:
via git as:
or via npm as:
Thereafter, the global object ESzip will be available in your app. Please note that this will not run on browsers so please test on actual devices/simulators only.
How to zip a folder?
ESzipexposes functionzipFolder, using which you can zip your source folder into destination zip file. Please note thatsourceanddestinationare meant to be absolute paths, whereinsourcehas to be an existing directory/file.zipFolderrequires 4 parameters, namely:source,destination,successCallback, anderrorCallback.sourceanddestinationhave to be absolute file URLs.