let fileTransfer = new Transfer();
fileTransfer.download("http://my.server.com/download?path=filelocationWithDifferentName, cordova.file.externalDataDirectory + ActualFileName).then((entry) => {
this.showToast("Download Completed");
this.openReport(file);
}, (error) => {
const alertFailure = this.alertCtrl.create({
title: `Download Failed!`,
subTitle: `${file} was not successfully downloaded. Error code: ${error.code}`,
buttons: ['Ok']
});
alertFailure.present();
});
});
Above is my code. after downloading server send file with actual file name. I tested it on android it showing error code 1.
Anybody knows the solution.