Re: Upload Progress Meter - what's the latest?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote:
I'm trying to figure out which direction the PHP community is going
when it comes to an upload progress meter.Since that meter would necessarily be CLIENT side, the PHP community
is pretty much ignoring it, since PHP runs on the SERVER.

Everything PHP returns from a server is "client side", so your argument seems to indicate that we need to write all of our HTML using JavaScript also. No, the fact is that a client-side GUI does NOT exist, so we need to build it ourselves using the tools we have. I do not have source control access to Mozilla, IE, Safari, and Opera, but I can control my own PHP source.

PHP receives uploads from clients and that client may not even be a web browser in all cases. From the server side, I need to be able to monitor

   * who is currently uploading files,
   * which files are being uploaded,
   * how big are the files being uploaded,
   * how much time has passed since upload began, and
   * what percentage of those files is completed

I do not need to return this data to a client at all times. Sometimes I just want to use the data system administration, analysis, and tracking. The most popular need would be for returning the information to the client, however, as you suggest.

Right now, PHP stops executing code from the time an upload begins until the time it is completed. In other languages like PERL as CGI, you can read STDIN directly in order to slurp in large POST data like file attachments. In such a case as that, solving this problem is trivial. Since PHP locks a programmer out of the loop during parsing and importing POST and GET variables, we need PHP code to break into that loop and return callback functions or update internal data structures directly. Part of the problem in addition to collection of the data is being able to share it with other PHP instances. Remember that PHP runs in Apache in most cases and does not have shared memory between PHP instances. Therefore, writing the upload data to an external data storage is necessary. That external storage could be Sqlite, PostgreSQL, MySQL, files, or even Memcache. I would love to see a memcache-like solution. But more importantly, I would like to see a solution which is adopted by the community rather than miserably hacked together then not supported and abandoned.

Anything you see with "PHP" "upload progress meter" together has to be
some kind of hack whose under-pinning is NOT PHP at all, but is
JavaScript or similar client-side technology.

Not true. The graphical display is HTML, DHTML, JavaScript, etc...but the means of monitoring the progress from the server side MUST be done with PHP. The code that I have seen so far requires hooks into PHP which execute callback functions periodically in order to update the progress of uploaded files as PHP processes input.
Why don't you ask the guys who write BROWSERS why *they* don't provide
a nice API/interface to display progress, or, better yet, why the
browser itself doesn't just do it once and for all for everybody?
That is a good idea, and I will recommend it for future solutions. For short term, that is not the focus of this email.

Dante

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux