Phonegap File Download to device - Which device path to take?

我与影子孤独终老i 提交于 2020-01-13 09:45:22

问题


i was researching on how to download a file to the native filesystem via a URL with phonegap. I then read about this method:

http://docs.phonegap.com/en/1.4.1/phonegap_file_file.md.html#FileTransfer_download

It should allow one to save files directly via a URL to the device. But it needs a specified target where to save the file.

target - Full path of the file on the device

What would be best practise to choose here, so the file does not just get hidden in some folder, but is accessible. What differences are there between android and ios (maybe also windows phone) ?

TL;DR: where to save downloaded file with phonegap?

Thanks in advance!


回答1:


here is a list of mobile paths from the w3c standard: http://wiki.phonegap.com/w/page/35605874/Planning%3A%20File%20API

and here is how you use it with phonegap: http://docs.phonegap.com/en/1.4.1/phonegap_file_file.md.html#LocalFileSystem

so you have to request the file system onSuccess you can use the path

here a full example: Writing and reading file in phonegap



来源:https://stackoverflow.com/questions/9361577/phonegap-file-download-to-device-which-device-path-to-take

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!