PHP Upload Progress Bar
Moderator: General Moderators
PHP Upload Progress Bar
Oooooh:
http://pdoru.from.ro/
http://pdoru.from.ro/
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Didn't seem to do anything for me when I tried the demo.
It opened a popup, hung for a while, then threw a window that said upload complete
Again, I reckon you can do this with AJAX.
Send the file, have ajax, every 1 or 2 seconds, query the server for the file size of the upload so far, compare it against the full file size sent from the file field and do your calculations
Two nested divs always work well to make little progress bars.
It opened a popup, hung for a while, then threw a window that said upload complete
Again, I reckon you can do this with AJAX.
Send the file, have ajax, every 1 or 2 seconds, query the server for the file size of the upload so far, compare it against the full file size sent from the file field and do your calculations
Two nested divs always work well to make little progress bars.
Where would you get the size of the original file from without going through the user's hard drive?d11wtq wrote:Send the file, have ajax, every 1 or 2 seconds, query the server for the file size of the upload so far, compare it against the full file size sent from the file field and do your calculations
<edit>It worked fine for me. Did you give it a file > 1mb?</edit>
You could combine the ideas from this upload thing with an ajax system .. still use the pop up window, just have it use Ajax to get the info rather than a meta refresh.Grim... wrote:Where would you get the size of the original file from without going through the user's hard drive?d11wtq wrote:Send the file, have ajax, every 1 or 2 seconds, query the server for the file size of the upload so far, compare it against the full file size sent from the file field and do your calculations
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Hmmm.. yeah it was a PDF that was 1.4MB. Usinf Firefox 1.0.5 in Linux.Grim... wrote:Did you give it a file > 1mb?
I'll give it another shot.
You'd retreive the original filesize by reading the values from $_FILES['field_name'][] although I'm not sure they'd appear midway through the upload. The client sends the data as far as I'm aware.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I failed, on first attempt 
Was trying to use ajax to do it from a single file but of course as soon as you hit the submit button it wait until the data is sent
EDIT | Ohhhhhh
It's coming to life now 
EDIT again | Gives up
Was trying to use ajax to do it from a single file but of course as soon as you hit the submit button it wait until the data is sent
EDIT | Ohhhhhh
EDIT again | Gives up
Last edited by Chris Corbyn on Wed Nov 02, 2005 2:53 pm, edited 1 time in total.