I am getting a JSON response from a web service that returns a file in either binary or base64 . I want to save this file to the fileSystem.
I also wanted to know which methods in the Phonegap FileAPi i need to use?
There is no default place for downloads
Look the phonegap's File API for more info.
With phonegap you can request de temporary or the permanent file system
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fail);
on iOS PERSISTENT returns the Documents directory, and the TEMPORARY returns the Caches directory on Android PERSISTENT returns the root of the SD card or phone memory, and TEMPORARY returns a folder inside the data folder.
To download the files use the FileTransfer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.