cordova-plugin-eszip
v0.0.13
Published
A cordova plugin to zip files and folders in cordova app. Requies cordova-plugin-file.
Downloads
1
Maintainers
Readme
cordova-plugin-eszip
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:
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?
ESzip
exposes functionzipFolder
, using which you can zip your source folder into destination zip file. Please note thatsource
anddestination
are meant to be absolute paths, whereinsource
has to be an existing directory/file.zipFolder
requires 4 parameters, namely:source
,destination
,successCallback
, anderrorCallback
.source
anddestination
have to be absolute file URLs.