Skip to content

Commit 9b8e54a

Browse files
committed
we ignoring data from first occurrence
1 parent afa613d commit 9b8e54a

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
@@ -412,13 +412,19 @@
412412
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
413413
// Accesss to the native XHR object is required to add event listeners
414414
// for the upload progress event:
415+
var first_occurrence = true
415416
if (xhr.upload) {
416417
$(xhr.upload).bind('progress', function (e) {
417418
var oe = e.originalEvent;
418419
// Make sure the progress event properties get copied over:
419420
e.lengthComputable = oe.lengthComputable;
420-
e.loaded = oe.loaded;
421-
e.total = oe.total;
421+
if(first_occurrence == true) {
422+
oe.loaded = 0;
423+
e.loaded = 0;
424+
} else {
425+
e.loaded = oe.loaded;
426+
first_occurrence = false;
427+
}
422428
that._onProgress(e, options);
423429
});
424430
options.xhr = function () {

0 commit comments

Comments
 (0)