如何在Ionic 2中的本地存储根目录中存储pdf文件 [英] How to store pdf file on Local Storage Root Directory in Ionic 2
问题描述
我想使用pdfmake创建pdf文件,并将此pdf存储在本地根存储目录中。新文件夹应与其他文件夹并行,如android,bluetooth。我已经给出了下面的文件夹列表。
I want to create pdf file using pdfmake and store this pdf on the local root storage directory. new folder should be parallel to other folders like android ,bluetooth. I have given folder list below.
哪种方法适用于此?
我试过一些方法文件native like-externalDataDirectory,来自 http://ionicframework.com/docs/native/file/ <的dataDirectory / a>
I have tried some method of file native like-externalDataDirectory,dataDirectory from http://ionicframework.com/docs/native/file/
- 内部存储
| - .IdeaDesktopHD
|- .IdeaDesktopHD
| - .lelauncher
|- .lelauncher
| - .magic
|- .magic
| - .powercenterhd
|- .powercenterhd
| - 警报
| - Android
|- Android
| - 音频
| - 蓝牙
| - 联系
| - 数据
| - DCIM
|- DCIM
| - 文件
| - 下载
| - googleota
|- googleota
| - legc
|- legc
| - LenovoReaper
|- LenovoReaper
| - LesyncDownload
|- LesyncDownload
| - 电影
| - MyFavorite
|- MyFavorite
| - 通知
| - 其他
| - 图片
| - 播客
| - powercenterhd
|- powercenterhd
| - 铃声
| - SHAREit
|- SHAREit
我知道应该使用哪种方法或功能?
Any idea which method or function i should use ?
推荐答案
试试这个
downloadImage(url: string) {
this.fileTransfer.download(encodeURI(url),"file:///storage/emulated/0/folderName/file.pdf")
.then((
console.log('
}, (error) => {
console.log('error occured');
});
}
这篇关于如何在Ionic 2中的本地存储根目录中存储pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!