0
試圖打開一個文件Class not found
離子本地文件器2的錯誤類未找到
.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文件,沒有工作