0

I'm going to use the Ionic native Transfer plugin as shown below. Problem is here this.file.dataDirectory.It shows error like [ts] Property 'dataDirectory' does not exist on type 'File'..Can you tell me what is the solution for this?

download() {
        const fileTransfer: TransferObject = this.transfer.create();
        const url = 'http://www.example.com/file.pdf';
        fileTransfer.download(url, this.file.dataDirectory + 'file.pdf').then((entry) => {
            console.log('download complete: ' + entry.toURL());
        }, (error) => {
            // handle error
        });
    }
maninak
  • 2,633
  • 2
  • 18
  • 33
Sampath
  • 63,341
  • 64
  • 307
  • 441

1 Answers1

0

Oh.. My bad :(

I have to install File plugin too :D

$ ionic cordova plugin add cordova-plugin-file --save
$ npm install --save @ionic-native/file
Sampath
  • 63,341
  • 64
  • 307
  • 441