Zip

Contents

A Cordova plugin to unzip files in Android and iOS.

https://github.com/MobileChromeApps/cordova-plugin-zip

Ionic 压缩减压Zip插件的安装(Installation)

ionic cordova plugin add cordova-plugin-zip npm install @ionic-native/zip

Ionic 压缩减压Zip插件支持的平台(Supported Platforms)

  • Android
  • iOS

Ionic 压缩减压Zip插件的用法(Usage)

import { Zip } from '@ionic-native/zip';

constructor(private zip: Zip) { }

...

this.zip.unzip('path/to/source.zip', 'path/to/dest', (progress) => console.log('Unzipping, ' + Math.round((progress.loaded / progress.total) * 100) + '%'))
 .then((result) => {
   if(result === 0) console.log('SUCCESS');
   if(result === -1) console.log('FAILED');
 });