diff --git a/app/assets/javascripts/jquery-fileupload/jquery.fileupload.js b/app/assets/javascripts/jquery-fileupload/jquery.fileupload.js index a4cfdc0..f1caab2 100644 --- a/app/assets/javascripts/jquery-fileupload/jquery.fileupload.js +++ b/app/assets/javascripts/jquery-fileupload/jquery.fileupload.js @@ -412,12 +412,19 @@ xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); // Accesss to the native XHR object is required to add event listeners // for the upload progress event: + var first_occurrence = true if (xhr.upload) { $(xhr.upload).bind('progress', function (e) { var oe = e.originalEvent; // Make sure the progress event properties get copied over: e.lengthComputable = oe.lengthComputable; - e.loaded = oe.loaded; + if(first_occurrence == true) { + oe.loaded = 0; + e.loaded = 0; + first_occurrence = false; + } else { + e.loaded = oe.loaded; + } e.total = oe.total; that._onProgress(e, options); });