XUpload - progress bar keeps going over 100%
progress bar keeps going over 100%
When I upload an flv file the progress bar goes over 100%, sometimes 120%, then when the upload is finished , it jumps back to 100% before redirecting.
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
This is interesting. First time hear about problem like this. What browser do you use? Tested in sevaral browsers - same effect?
I'm not sured...but probably you have mod_gzip enabled on your server and flv zipping before sending and compressing to 10 instead of 11 Mb.
Can you PM me URL to your upload form to test myself if possible?
I'm not sured...but probably you have mod_gzip enabled on your server and flv zipping before sending and compressing to 10 instead of 11 Mb.
Can you PM me URL to your upload form to test myself if possible?
I Pmd you the URL.
I also did some more tests with over file types such as wmv, it seems there is no problem for smaller files since their sizes are detected correctly. But for larger files bigger than 10 MB or so there is a discrepancy in the detected size and the actual size.
ex. 10.9 MB .flv detected as 10.0
17.7 MB .mov detected as 17.0
Also, no mod_gzip enabled since I have the following in root folder of the site in .htaccess
<IfModule mod_security.c>
SetEnvIfNoCase Content-Type \
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>
I also did some more tests with over file types such as wmv, it seems there is no problem for smaller files since their sizes are detected correctly. But for larger files bigger than 10 MB or so there is a discrepancy in the detected size and the actual size.
ex. 10.9 MB .flv detected as 10.0
17.7 MB .mov detected as 17.0
Also, no mod_gzip enabled since I have the following in root folder of the site in .htaccess
<IfModule mod_security.c>
SetEnvIfNoCase Content-Type \
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Hmmm...uploaded 5Mb flv file to your server - filesize detected exactly the same. Try other computers or ask your friends from another networks try this.
Check out logs.txt file in xupload folder, total upload size taken from request header printing there. But it should be more then filesize(including headers and form data), not less.
My only idea is still that upload data gzipping somewhere (maybe some network accelerator). AVIs zipping badly so no effect for them, FLV are better. Try to upload FLV containing '000000....' - if it's zipping then it will be compressed very good and you'll see > 1000%.
You can update up to 2.5 version for free: http://www.sibsoft.net/forum/customers- ... -t103.html
Check out logs.txt file in xupload folder, total upload size taken from request header printing there. But it should be more then filesize(including headers and form data), not less.
My only idea is still that upload data gzipping somewhere (maybe some network accelerator). AVIs zipping badly so no effect for them, FLV are better. Try to upload FLV containing '000000....' - if it's zipping then it will be compressed very good and you'll see > 1000%.
You can update up to 2.5 version for free: http://www.sibsoft.net/forum/customers- ... -t103.html
Like I said, small files are detected properly, it is larger files than fail.
I did what you said and looked at logs and did another test, here is what happened:
I uploaded quicktime .mov file:
- size 18609761 bytes
- upload log reports size as 18610382 bytes
I zipped the same .mov file with best zip compression
- size 18490535 bytes
- upload log reports size as 18491159 bytes
In both cases, progress bar reports size as 17 MB.
I also asked friends in different networks to upload the same file and they got the same result.
Could the progress bar functions be rounding off the size too much and losing precision?
I did what you said and looked at logs and did another test, here is what happened:
I uploaded quicktime .mov file:
- size 18609761 bytes
- upload log reports size as 18610382 bytes
I zipped the same .mov file with best zip compression
- size 18490535 bytes
- upload log reports size as 18491159 bytes
In both cases, progress bar reports size as 17 MB.
I also asked friends in different networks to upload the same file and they got the same result.
Could the progress bar functions be rounding off the size too much and losing precision?
Hmm... I think the rounding off might be the problem...
I changed
$totalKB = int($totalKB/1024); # Convert to Mb if > 10Mb
to
$totalKB = ceil($totalKB/1024); # Convert to Mb if > 10Mb
in upload_status.cgi and it seems to work better now.
At least the progress will never go over 100% if you over-report the size.
I changed
$totalKB = int($totalKB/1024); # Convert to Mb if > 10Mb
to
$totalKB = ceil($totalKB/1024); # Convert to Mb if > 10Mb
in upload_status.cgi and it seems to work better now.
At least the progress will never go over 100% if you over-report the size.
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Hmmm....can be but strange. My uploads are too fast to notice this in the end of upload.
Then better use
This will round much accurately and keep 1 sign after point.
Then better use
Code: Select all
$totalKB = sprintf("%.1f",$totalKB/1024);