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:100It 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)