问题
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?
I have tried some method of file native like-externalDataDirectory,dataDirectory from http://ionicframework.com/docs/native/file/
- Internal Storage
|- .IdeaDesktopHD
|- .lelauncher
|- .magic
|- .powercenterhd
|- Alarms
|- Android
|- Audio
|- Bluetooth
|- Contact
|- data
|- DCIM
|- Document
|- Download
|- googleota
|- legc
|- LenovoReaper
|- LesyncDownload
|- Movies
|- MyFavorite
|- Notifications
|- Others
|- Pictures
|- Podcasts
|- powercenterhd
|- Ringtones
|- SHAREit
Any idea which method or function i should use ?
回答1:
try out this
downloadImage(url: string) {
this.fileTransfer.download(encodeURI(url),"file:///storage/emulated/0/folderName/file.pdf")
.then((
console.log('
}, (error) => {
console.log('error occured');
});
}
来源:https://stackoverflow.com/questions/44264105/how-to-store-pdf-file-on-local-storage-root-directory-in-ionic-2