Skip to content

osro/cordova-plugin-zip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-zip

A Cordova plugin to unzip files in Android, iOS, Windows Phone 8.1.

Installation

cordova plugin add https://github.com/osro/cordova-plugin-zip

Usage

zip.unzip(<source zip>, <destination dir>, <callback>, [<progressCallback>]);

Both source and destination arguments can be URLs obtained from the HTML File interface or absolute paths to files on the device.

The callback argument will be executed when the unzip is complete, or when an error occurs. It will be called with a single argument, which will be 0 on success, or -1 on failure.

The progressCallback argument is optional and will be executed whenever a new ZipEntry has been extracted. E.g.:

var progressCallback = function(progressEvent) {
    $( "#progressbar" ).progressbar("value", Math.round((progressEvent.loaded / progressEvent.total) * 100));
};

The values loaded and total are the number of compressed bytes processed and total. Total is the file size of the zip file.

Release Notes

3.0.0 (May 1, 2015)

  • Updated SSZipArchive (ios lib) to 0.2.1
  • Update file plugin dependency to use npm version (cordova-plugin-file)

2.1.0 (May 1, 2014)

  • Added progress events
  • Fix iOS path handling when given file: URLs as src/target

About

Zip plugin for Cordova apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 84.0%
  • Objective-C 7.2%
  • C# 4.3%
  • Java 3.2%
  • JavaScript 1.3%