Problem with FileTransfer () download in Phonegap


I am developing a Phonegap application for Android and IOS. I am trying to download a file (.pdf) from a server using FileTransfer () and it works fine. But when I use fileTransfer.onprogress, it seems to upload more than the file size (my file is 20 MB and it downloads 40 MB 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 do not know why? Can someone explain to me why this is happening?

+4
source share

All Articles