Phonegap : Downloading large files on Windows Phon

2019-06-26 08:06发布

问题:

I'm developing a mobile app with Phonegap and I need to download zip-files which might be over 50MB.

I'm using Cordova's file-transfer plugin to do this job. Now, on iOS and Android this works just fine, but when I do the same thing on Windows Phone the application hangs out files that are larger than 20MB.

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.

PhonGap documentation has this line which says that downloading is supported only on iOS and Android? http://docs.phonegap.com/en/edge/cordova_file_file.md.html#FileTransfer

It is also possible (only on iOS and Android) to download a file from a remote server and save it on the device.

But what confuses me is that then again this site says that the support is added on some point(?) http://phonegap.com/2012/04/11/phonegap-1-6-released/

Windows - file download API

So, is it really supported on Windows or not? Or is there some alternative way to do this on Windows Phones.

回答1:

Ok, I didn't figure out how to do this with the Apache's File-Transfer plugin directly.

I found this background downloader which was able to download successfully files around 100MB (probably even larger) on Windows Phone 8.1.

https://github.com/sgrebnov/cordova-plugin-background-download