Shroder
asked on
AJAX - Upload Monitoring
I found a script that actually monitors an upload, and I was trying to figure out how it works. Unfortunetly I can't find the function that collects the statistics in the source (I can just see it being called). So I'm hoping someone here can shed some light on how to do an upload progress bar with ajax.
ASKER
http://bluga.net/projects/uploadProgressMeter/
That is where I saw the example, and got the code from.
I thought it would probably be complicated, so for right now I'm just wanting to get an understanding of how it is done. I was hoping of figuring that out by looking at the function I mentioned before.
That is where I saw the example, and got the code from.
I thought it would probably be complicated, so for right now I'm just wanting to get an understanding of how it is done. I was hoping of figuring that out by looking at the function I mentioned before.
I believe that how this works is that the pach adds the function upload_progress_meter_get_ info. This function depends on the hidden variable UPLOAD_IDENTIFIER that was set to a random value when the upload form submits. That random value can then be used to retrieve data about the upload.
What you have to understand is that this works parallel. In other words: while the form is uploading, you call a secondary PHP page every second and call the function upload_progress_meter_get_ info to ask how far the upload is. In reality, you open two HTTP connections, one of which is uploading the files while the other is used to get statistics.
What you have to understand is that this works parallel. In other words: while the form is uploading, you call a secondary PHP page every second and call the function upload_progress_meter_get_
ASKER
The part that has me stumped is how the second php page/script can keep track of the upload progress. Is it taking the size of the tmp file on the server? If so is the first php script (that the file is being uploaded to) set to upload the file to some place other then tmp?
Thanks for your help so far.
Thanks for your help so far.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ahh. So that is where you have to recompile the php binary?
That also explains why I couldn't find the function.
That also explains why I couldn't find the function.
Yep. More questions?
ASKER
Sorry for the delay. That is all. Thank you for your help!
Just maybe though you'd like to know.
On the other hand; if you'd like an answer on your question, please post a reference or code.