0

I'm currently developing a Cordova app. I'm trying to unzip a zip file. I used the cordova-plugin-zip to make this possible. However my zip file is mixed with folder and files. When I tried to unzip it, it only extract the files and the folders are ignore. How to make this possible? Thanks!

Here's some of my codes.

 public static UnZipFile(filename: string, extractedpath: string) {

  var promise = new Promise<string>((resolve, reject) => {
     AppBridge.createDirectory(extractedpath); //This creates the directory path
     var filePath: string = AppBridge.getZipName(filename); //Get the zip file name
     var destination: string = AppBridge.outputDirectory(extractedpath); //Get the output directory

     zip.unzip(filePath, destination);

   });
}

The AppBridge is written in C#, my project somehow mixed in .Net Core and Cordova. That's why the C# kind of limited of what can do. I just used it to get some information to Windows.

Rich
  • 3,928
  • 4
  • 37
  • 66

1 Answers1

0

It seems that you're not the first on to have the same issue : Recursive unzip? #12 The problem could be because you're unzipping on a read-only filesystem.

Can you change something about that ?

Another solution is to use another plugin which seems to be working. But I haven't try my self.

Yesub
  • 437
  • 6
  • 17