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!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With