我将使用如下所示的 Ionic native Transfer 插件。问题就在这里。this.file.dataDirectory
它显示错误[ts] Property 'dataDirectory' does not exist on type 'File'.
。你能告诉我这个问题的解决方案是什么吗?
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
});
}