Hanh Le
Hanh Le

Reputation: 894

Issue about FileTransfer() download in PhoneGap


I have been developing a Phonegap App for Android and IOS. I am trying to download a file(.pdf) from server using FileTransfer() download, and it's working normally. But when I use fileTransfer.onprogress then it seems to download more than the size of the file (my file is 20Mb and it downloads 40Mb more than 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.

enter image description here

I don't known why? Can anyone explain to me why this is happening?

Upvotes: 4

Views: 1712

Answers (1)

Related Questions