moxiecode/plupload — Issue #506: UploadProgress event should not be called after FileUploaded
Author: tomastelensky
Created: 2012-02-26 13:25:25+00:00
State: open

Currently, the UploadProgress event can be fired on file after the FileUploaded event, which I think is wrong - the last UploadProgress event (with 100%) should fire BEFORE the FileUploaded event.

The main reason is that the FileUploaded event might have already reported error, so you for example rewrite the progressbar to some error message, but then suddenly, last UploadProgress event comes with 100% so everything is rewritten then.

My workaround for this is:

uploader.bind('UploadProgress', function(up, file) {

if (file.status != plupload.DONE) // use this condition to handle if FileUploaded was already called
$(file.id).getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%";
}