Hello, I am newbie for ionic 3 development. I am trying to use file and fileTransfer plugin for downloading images from server, but not getting anything when installed in android device.
Here is my code
download(id, image){
console.log('gallery id is','id',id,'image',image);
const fileTransfer: FileTransferObject = this.transfer.create();
var downloadurl = "http://path/to/file/images/gallery/"+image
var uri = encodeURI(downloadurl);
var filepath = this.file.dataDirectory+ '/'+ image;
fileTransfer.download(uri, filepath, true).then((entry) => {
console.log('download complete: ' + entry);
this.imageSrc = entry.toUrl();
console.log(this.imageSrc);
}).catch(error => {
console.log(JSON.stringify(error));
});
}
Did I miss anything in the code, Please I need guidance for this issue.
Thank you.