Download zip file and Unzip it using Cordova FileTransfer Plugin

Hi,

I am trying to download zip file by using FileTransfer and FIle corodva plugin, but i am getting LocalFileSystem error.
It will be good to have a tutorial that shows how to download zip file and how to unzip.

window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
var url = "https://someurl/test.zip"; // zip url
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
var zipPath = fs.root.fullPath + "/test.zip"; // full file path
var fileTransfer = new FileTransfer();
fileTransfer.download(url, zipPath, function (entry) {
console.log(entry.fullPath); // entry is fileEntry object

}, function (error) {
console.log("Some error");

});
});

Thanks!
Ashish
1 person has
this question
+1
Reply