Hi guys !
I’m trying to make a download functionality in my Ionic 3 app, but i’m stucked with the File plugin.
this.fileTransfer.download(url, this.file.dataDirectory + fileName, true).then((entry) => {
//here logging our success downloaded file path in mobile.
console.log('download completed: ' + entry.toURL());
}, (error) => {
//here logging our error its easier to find out what type of error occured.
console.log('download failed: ' + error);
})
I get this error : Property ‘dataDirectory’ does not exist on type ‘File’
Here is my constructor (assume that I’ve imported the File plugin):
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl : ViewController, public rest_api: RestApiProvider,
private loadingCtrl: LoadingController, private sanitizer: DomSanitizer, private transfer: FileTransfer, private file: File,
private globalService: GlobalService, public modalCtrl: ModalController) {
}
Thanks for your help