Hi!
I’m using FileTransfer to download an image into the device. I can download it only into dataDirectory path, but where is the path to reference in a
?
I use file.applicationDirectory + ‘www/assets/images/file.jpg’ to reference to a original file, but I can’t download files into applicationDirectory becouse is readonly.
Thank you
Perhaps this will help you, I solved the problem myself:
if (this.device.platform == 'Android') {
this.img_path = cordova.file.externalRootDirectory + 'DCIM/Camera/IMG_' + fname;
} else {
this.img_path = cordova.file.documentsDirectory + fname;
}
fileFileTransfer.download('http://sitename.com/' + fname, this.img_path).then((entry) => {
cordova.plugins.imagesaver.saveImageToGallery(this.img_path, this.onSaveImageSuccess, this.onSaveImageError);
// done
}, (error) => {
// error
});