【发布时间】:2018-01-24 11:20:49
【问题描述】:
我在尝试打开文件时收到错误Class not found
.ts
open(){
this.platform.ready().then(() => {
this.fileOpener.open(this.entry.nativeURL, this.attachment.mime).then(() => {
console.log('file opened')
}, err => {
console.log('error open file: ', err)
});
});
}
this.entry.nativeURL是使用File Transfer的下载结果
nativeURL:file:///storage/emulated/0/Download/someFile.docx
this.fileTransfer.download(url, this.storageDirectory + this.attachment.fileName, trustAllHosts).then((entry) => {
console.log('entry: ', entry);
this.entry = entry;
}
this.attachment.mime:application/vnd.openxmlformats-officedocument.wordprocessingml.document
我也试过application/pdf 的pdf文件,没用
【问题讨论】:
标签: ionic-framework ionic2 cordova-plugins ionic3 ionic-native