Is there any way to get the status of a file that is being uploaded through the file uploaded field of a form?
It appears to me that the PHP parser doesn't even start working till all the data from a form has been completely uploaded from a form.
Maybe this is something better done with Javascript.
Upload progress
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
-
rapaddict_dot_com
- Forum Commoner
- Posts: 27
- Joined: Tue Mar 16, 2004 4:54 pm
What I've found so far.
From what I understand, php scripts can't access raw post data as it's being uploaded. Only after the data is uploaded and pre-parsed by php can you access it.
Now this pretty must makes an upload progress bar through PHP alone impossible, because it's to late to run a progress bar AFTER the file is already loaded.
This brings me to Javascript. From what I understand, Javascript does not have the capabilities of asking the browser how far along it's upload is either. So this rules out using Javascript for an accurate progressive upload bar. Now, if I'm not mistake, Javascript can access the file size of files chosen in a file upload file, at least in IE. So you can choose an average upload speed and make a predetermined guess as to how long it will take. But this will only be a guess.
While I do not know this for certain, I've heard that PERL does have the capability of accessing raw posted data as it's uploaded. Using a combination of PERL and javascript and PHP, some one has written a package that could do an accurate progressive uploading bar.
Here's the URL http://www.raditha.com/php/progress.php
Now this pretty must makes an upload progress bar through PHP alone impossible, because it's to late to run a progress bar AFTER the file is already loaded.
This brings me to Javascript. From what I understand, Javascript does not have the capabilities of asking the browser how far along it's upload is either. So this rules out using Javascript for an accurate progressive upload bar. Now, if I'm not mistake, Javascript can access the file size of files chosen in a file upload file, at least in IE. So you can choose an average upload speed and make a predetermined guess as to how long it will take. But this will only be a guess.
While I do not know this for certain, I've heard that PERL does have the capability of accessing raw posted data as it's uploaded. Using a combination of PERL and javascript and PHP, some one has written a package that could do an accurate progressive uploading bar.
Here's the URL http://www.raditha.com/php/progress.php