faqts : Computers : Programming : Languages : PHP : Common Problems : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

66 of 104 people (63%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I make a PHP progress bar when a user upload a file in a html form (<input type=file>)??

Dec 28th, 2003 02:08
Derrick Chiang, Jens Clasen, Miguel Angel Martinez,


There is a simple answer to that question: You can't!
Since Your PHP-script won't start before the upload is complete, it's 
obvious that this script can't display a progress bar - it would 
allways show 100%!
If You start thinking about other ways of creating such a progress bar, 
be advised that this can only be done at the client unless You create a 
HTTP-server on Your own since it is the server handling the post-
request needed to transmit a file.
====== ADDENDUM ======
Actually, there is a way to do it.  This method involves a popup window 
to indicate upload status, check it out... 
   http://www.raditha.com/php/progress.php
Enjoy!