简体   繁体   中英

Cordova iOS Filetransfer download file into www folder

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?

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

使用此处描述的FileTransfer对象的download方法http://docs.phonegap.com/en/1.9.0/cordova_file_file.md.html#FileTransfer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM