mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-04-28 00:02:49 +08:00
CB-8590 (Windows) Fixed download.onprogress.lengthComputable
github close #67
This commit is contained in:
@@ -361,7 +361,9 @@ exec(win, fail, 'FileTransfer', 'upload',
|
||||
total: evt.progress.totalBytesToReceive,
|
||||
target: evt.resultFile
|
||||
});
|
||||
progressEvent.lengthComputable = true;
|
||||
// when bytesReceived == 0, BackgroundDownloader has not yet differentiated whether it could get file length or not,
|
||||
// when totalBytesToReceive == 0, BackgroundDownloader is unable to get file length
|
||||
progressEvent.lengthComputable = (evt.progress.bytesReceived > 0) && (evt.progress.totalBytesToReceive > 0);
|
||||
|
||||
successCallback(progressEvent, { keepCallback: true });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user