Reputation: 137
I'm doing an IOS app with Cordova/phonegap and i have to download an XML file from a remote server, at the success event i need to override the already existing XML file inside the www folder with the just downloaded one. Any suggestion in how to?
Upvotes: 3
Views: 4816
Reputation: 3484
You can't update a file included in your app package. This would require an updated version of your app to be installed.
However, you can have an external directory host some dynamic data elsewhere on the device disk. You could have some default offline data included in your package, which could be updated by downloading content in this spare directory when the app gets online.
Here is an exemple of Cordova download FileTransfer for iOS: http://mythoughtsandexperiments.blogspot.fr/2013/10/phonegap-file-downloading-and.html
Upvotes: 1
Reputation: 5267
Use the download
method of the FileTransfer
object described here http://docs.phonegap.com/en/1.9.0/cordova_file_file.md.html#FileTransfer
Upvotes: 0