Search code examples
javascriptcordovazipunzipcordova-plugins

Unzip multipart archive(s) in Cordova


What I want to achieve is download all parts of a splitted zip archive into my cordova app (which already works) and then unzip this multipart archive, so that I can use the files in it.

With the help of the Cordova plugin "org.chromium.zip" I've already managed to unzip single part zip archives. On the multipart zip part I've zipped a video file and splitted it into parts with the help of 7zip. Then I've downloaded all parts of the archive onto my (emulator) device and startet the unzip of the first part. It does not throw an error and unpacks a file with the correct name, but only the size of a little more than one part of the archive. That means it doesnt unpack the whole file but only the part which I unzipped.

Is there a way to unzip multipart archives in Cordova?


Solution

  • Yes sir, there is a way! Try to concatenate all your multipart archive files into a single one - shown here: Unzipping a multi-part zip file volumes using Java - and then extract this single file.

    What you have to do is to write a cordova plugin (if any exists) for the concatenation and afterwards you pass the output file into your zip plugin.