PhoneGap的文件下载到设备 - 哪些设备路该如何走?设备、该如何、文件、PhoneGap

2023-09-07 18:02:15 作者:想被快乐绑架

我是研究如何通过与PhoneGap的URL的文件下载到本地文件系统。后来我读到这个方法:

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

应该允许人们通过URL来将设备直接保存文件。但它需要一个指定的目标在哪里保存文件。

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.

目标 - 在设备上的文件的完整路径

什么是最好的做法选择这里,所以该文件不一下就藏在某个文件夹,但访问。 Android和iOS(也许也是Windows手机)之间有什么区别?

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:?在哪里保存下载文件与PhoneGap的

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

在此先感谢!

推荐答案

下面是来自W3C标准的移动路径列表:http://wiki.phonegap.com/w/page/35605874/Planning%3A%20File%20API

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

和这里是你如何与PhoneGap的使用它:http://docs.phonegap.com/en/1.4.1/phonegap_file_file.md.html#LocalFileSystem

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

让你不得不请求文件系统的onSuccess您可以使用路径

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

下面一个完整的示例:写作和阅读文件的PhoneGap

here a full example: Writing and reading file in phonegap