Skip to content

Commit 1b191f7

Browse files
dimanlinsidorovua
authored andcommitted
we ignoring data from first occurrence
1 parent 95264ba commit 1b191f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/assets/javascripts/jquery-fileupload/jquery.fileupload.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,19 @@
419419
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
420420
// Accesss to the native XHR object is required to add event listeners
421421
// for the upload progress event:
422+
var first_occurrence = true
422423
if (xhr.upload) {
423424
$(xhr.upload).bind('progress', function (e) {
424425
var oe = e.originalEvent;
425426
// Make sure the progress event properties get copied over:
426427
e.lengthComputable = oe.lengthComputable;
427-
e.loaded = oe.loaded;
428-
e.total = oe.total;
428+
if(first_occurrence == true) {
429+
oe.loaded = 0;
430+
e.loaded = 0;
431+
} else {
432+
e.loaded = oe.loaded;
433+
first_occurrence = false;
434+
}
429435
that._onProgress(e, options);
430436
});
431437
options.xhr = function () {

0 commit comments

Comments
 (0)