Ionic v4 - unzip is not working... plz help me

Ionic information

Ionic CLI : 5.3.0 (C:\Users\jylee\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.4.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

I have faced a big problem with ionic/angular project.
My goal is decompress a zip file in ionic.
So I found plugins that those are @ionic-native/zip and cordova-plugin-zip.
ā€œ@ionic-native/zipā€: ā€œ^5.15.0ā€
ā€œcordova-plugin-zipā€: ā€œ^3.1.0ā€
Also I have installed @ionic-native/file(^5.11.0) and cordova-plugin-file(^6.0.2).
My code is so simpleā€¦
I just followed sample code on homepage sample.
this.zip.unzip(this.file.externalRootDirectory + ā€˜Download/map_images.zipā€™, this.file.externalRootDirectory + ā€˜Downloadā€™, (progress) => console.log(progress)).then((result) => {
console.log(result);
});
But this code have no message(success or fail)ā€¦
I have spent a lot time of this problemā€¦
Is somebody can help me?
Pleaseā€¦

Hi try following this video guide of ionic unzip plugin:


alternative try using this plugin for unzipping file:

Here is the quick guide:
install this plugin using this command through editor terminal or CMD ( Commn Prompt ) or whaatever you have:
npm install angular-ionic-unzip --save

Declare ( IonicUnzip ) to your app module providers something like tthis:

import {IonicUnzip} from 'angular-ionic-unzip';


@NgModule({
    providers:[IonicUnzip]
});

After then import it where you want to use it:

import {IonicUnzip} from 'angular-ionic-unzip';


// Some Code
constructor(private unzipService:IonicUnzip) {
        
        this.unzipService.unzip({
           targetDir: '/images',
           fileName: 'images.zip,     
        }).then(() => {
            //unzip complete
        }).catch((e) => {
            //unzipping failed
            console.log(e);
        });
    
    }
1 Like