如何在 Ionic 2 的本地存储根目录中存储 pdf 文件 [英] How to store pdf file on Local Storage Root Directory in Ionic 2
问题描述
我想使用 pdfmake 创建 pdf 文件并将此 pdf 存储在本地根存储目录中.新文件夹应与其他文件夹(如 android、蓝牙)平行.我在下面给出了文件夹列表.
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.
哪种方法可以解决这个问题?
which method will work on this?
我已经尝试了一些文件原生方法,如 http://ionicframework.com/docs/native/file/
I have tried some method of file native like-externalDataDirectory,dataDirectory from http://ionicframework.com/docs/native/file/
- 内部存储
|- .IdeaDesktopHD
|- .IdeaDesktopHD
|- .lelauncher
|- .lelauncher
|- .magic
|- .powercenterhd
|- .powercenterhd
|- 警报
|- 安卓
|- 音频
|- 蓝牙
|- 联系方式
|- 数据
|- DCIM
|- 文件
|- 下载
|- googleota
|- googleota
|-legc
|- 联想死神
|- 同步下载
|- 电影
|- 我的最爱
|- 通知
|- 其他
|- 图片
|- 播客
|- 电源中心
|- 铃声
|- 分享
知道我应该使用哪种方法或功能吗?
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屋!