The problem is that when you use the default autoUpload option the files are submitted immediately in the add callback and for the first n calls to progressall callback, the data.total is not fully updated. (n depends on workstation speed and on progressInterval option)
The solution I have found is to calculate the total files length in the 1st call of add and to use it in the progressall.
var originalAdd = $.blueimp.fileupload.prototype.options.add; var iFilesCount = 0; var dataTotal = 0; $('#fileupload').fileupload({ ... progressall: function (e, data) { if (dataTotal == 0) { dataTotal = 1; } var iProgress = parseInt(data.loaded / dataTotal * 100, 10); $('#progress .progress-bar').css('width', iProgress + '%'); }, add: function (e, data) { if (iFilesCount <= 0) { iFilesCount = data.originalFiles.length; dataTotal = 0; var i = 0; // sum up files lengths for (i=0; i < iFilesCount ;i++){ dataTotal = dataTotal + data.originalFiles[i].size; } } iFilesCount--; // recall default add callback originalAdd.call(this, e, data); } ... }
The output of console.log( data.loaded + ' / ' + data.total + ' / ' + dataTotal) in progressall
536710 / 1610128 / 30060524 \ 1073418 / 6977218 / 30060524 | 1610128 / 8587402 / 30060524 | 2146838 / 12881204 / 30060524 | 2683550 / 13954660 / 30060524 | 3220258 / 16638300 / 30060524 |-- progress bar is not accurate 3756968 / 19858646 / 30060524 | 4293676 / 24689178 / 30060524 | 4830384 / 27909544 / 30060524 / 5367092 / 30060524 / 30060524 \ 5903800 / 30060524 / 30060524 | 6440510 / 30060524 / 30060524 | 6977218 / 30060524 / 30060524 | 7513946 / 30060524 / 30060524 | 8050674 / 30060524 / 30060524 |-- accurate progress bar ... | ... | 30060524 / 30060524 / 30060524 /