我一直在为Android和IOS开发Phonegap应用程序。我试图使用FileTransfer()下载从服务器下载文件(.pdf),它正常工作。但是当我使用fileTransfer.onprogress时,它似乎下载的文件大小超过文件大小(我的文件是20Mb,下载40Mb超过2x)。
fileTransfer.onprogress = function(progressEvent) {
if (progressEvent.lengthComputable) {
var percent = progressEvent.loaded/progressEvent.total;
//percent allways equal 2, than more 2x size of real file
console.log(percent);
}
};
//Else FileTransfer() upload working well.
我不知道为什么?任何人都可以向我解释为什么会这样吗?
答案 0 :(得分:3)