我将使用the Ionic native Transfer plugin,如下所示。问题是,在这里,this.file.dataDirectory.It显示了错误,比如[ts] Property 'dataDirectory' does not exist on type 'File'..Can,您告诉我这个问题的解决方案是什么?
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
});
}发布于 2017-06-08 07:34:52
哦..。我的错:(
我也必须安装File plugin :D
$ ionic cordova plugin add cordova-plugin-file --save
$ npm install --save @ionic-native/filehttps://stackoverflow.com/questions/44428434
复制相似问题