Re: progress bar for a server side process

From: Date: Fri, 06 Sep 2002 02:41:38 +0000
Subject: Re: progress bar for a server side process
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115394@lists.php.net to get a copy of this message
i've soughted out a solution with flash :) http://electroteque.dyndns.org:1023/demo/uploader/ except it adds the html output above the html do most browsers support this ? "Richard Lynch" <rich@phpbootcamp.com> wrote in message news:php.general-115382@news.php.net... > >hi there i have created a script to regenerate thumbnails for a photo > >gallery , i have changed my code to use gd true color although it takes > >forever now , i have it generating 20 at a time then doing the rest but > >still takes forever , i know its impossible to generate a true progress bar > >for image uploads via a browser but how about server side processes ? > > You can do something like this: > > <?php > for ($i = 0; $i < 20; $i++){ > # Generate next TrueColor image: > echo "."; > flush(); > } > ?> > > And the user *should* see a single '.' appear as each image is completed. > > NOTES: > You need the flush() because Apache/HTTP buffers output until enough content > is there to make it worth sending. flush() forces the data out the door. > > You'd probably really be better off just telling them that the thumbnails > will be finished in about 5 minutes (or however long it takes) and letting > them get on with life. Who wants to sit there watching the dots go by? You > can set up a scheduled task to re-generate the thumbnails requested, and use > a database table to track requests. > > -- > Like Music? http://l-i-e.com/artists.htm >

« previous php.general (#115394) next »