Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 390
Dennis Avatar asked Feb 20 '12 13:02

Dennis


1 Answers

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

like image 53
Mario Avatar answered Oct 25 '22 01:10

Mario