CB-8590 (Windows) Fixed download.onprogress.lengthComputable

github close #67
This commit is contained in:
alsorokin
2015-03-05 10:56:42 +03:00
committed by sgrebnov
parent dc2161be2d
commit 3ff8382929
+3 -1
View File
@@ -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 });
});