I have run into an issue while attempting to download a song/file from a local server using the FileTransfer cordova plugin. While some links are successful in downloading the song, when I test it on my phone, I cannot locate the downloaded file.
Any assistance would be greatly appreciated.
let destination = cordova.file.dataDirectory + this.currentSong.title+".mp3";
//cordova.file.externalRootDirectory;
fileTrnsfr.download(uri,destination,true).then(
(entry)=> {
console.log("Downloaded");
const alertSuccess = this.alertCtrl.create({
title: "Download Succeeded",
subTitle : "File saved in " + destination,
buttons:['Ok']
});
alertSuccess.present();
},
(error) => {
console.log("An error occurred: " + error);
const alertFailure = this.alertCtrl.create({
title: "Download Failed",
subTitle : "File downloading failed: "+ destination + " from " + uri,
buttons:['Ok']
});
alertFailure.present();
}
);
}); }