Zip

Contents

A Cordova plugin to unzip files in Android and iOS.

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

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

ionic cordova plugin add cordova-plugin-zip npm install @ionic-native/zip
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/zip

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

  • Android
  • iOS

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

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

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');
 });