Topic: UploadProgress and FileUploaded events problem

Hello.
I was trying the plupload (using 1.2.4) and I came across a rather strange thing while logging the file.percent value of events UploadProgress and FileUploaded - the percentage seems to be "delayed".

edit: I'm using the Flash runtime.

code:

    uploader.bind('UploadProgress', function(up, file){
        var foo = new Date;
        var unixtime = parseInt(foo.getTime() / 1000);
        console.log('Upload Progress:'+unixtime+':'+file.percent);
    });

    uploader.bind('FileUploaded', function(up, file){
        var foo = new Date;
        var unixtime = parseInt(foo.getTime() / 1000);
        console.log('File Uploaded:'+unixtime+':'+file.percent);
    });

console output:

Upload Progress:1286957141:0
Upload Progress:1286957142:26
Upload Progress:1286957143:51
File Uploaded:1286957146:76
Upload Progress:1286957146:76
Upload Progress:1286957146:100

It says 0% when it's in fact 26% (first chunk is already uploaded). It continues this way until anouncing the last three lines in a single moment. FileUploaded for some reason says 76% instead of 100% and after that the UploadProgress fires twice for no reason, since the file is already uploaded...

(note: all 6 lines appear for each file in the same way even if I upload more than one file, so it has nothing to do with "total upload progress")

Am I wrong expecting only the first four lines (=events fired) when the file has 4 chunks? Why the percentage is "delayed" from the real state? Am I doing something wrong? How do I fix it?

Last edited by dxh (2010-10-13 10:07:42)

Re: UploadProgress and FileUploaded events problem

I have this same problem. From looking over the forum posts, I can see a few other users mentioning this, too.

This plug-in has got a sleek website, but I don't think it's quite ready for prime-time. Though, I do appreciate the idea.

Re: UploadProgress and FileUploaded events problem

Grab the GitHub version it fires the event in the right order. But I don't know about the percentage calculations tested it on the GitHub version using the new events.html example and it works fine when used with flash.

Re: UploadProgress and FileUploaded events problem

Hi,

Can you please give the link to the github version?  I went to https://github.com/moxiecode/plupload click downloads and only 1.2.3 is availble.

I tried using examples.html with 1.2.4 and I keep on getting an error:

e.preinit is not a function
[Break On This Error] (function(c){var d={};function a(e){re... d[c(this[0]).attr("id")]}}})(jQuery);

Any chance you can directly link to the zip file (where examples.html works) for download?

Thanks

Last edited by no1youknowz (2010-11-10 19:42:00)