Re: Download speed limit

From: Date: Wed, 16 May 2007 22:14:07 +0000
Subject: Re: Download speed limit
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-255038@lists.php.net to get a copy of this message
Between 90 and 350 MB. ----- Original Message ----- From: "Jim Lucas" <lists@cmsws.com> To: "Rangel Reale" <listas@rangelreale.com> Cc: <php-general@lists.php.net> Sent: Wednesday, May 16, 2007 6:41 PM Subject: Re: [PHP] Download speed limit
Rangel Reale wrote:
Hello! For my application I need to limit the speed that my application sends data, in my case a binary file. I need to send the speed as a parameter, like: sendfile.php?speed=20000 Would send the file at 20kb/s (forgetting about real byte counts for this example). To send the file, I am doing:
    $fp=fopen($this->contentfile,"rb");
    while(!feof($fp)){
        print(fread($fp,1024*8));
        flush();
        ob_flush();
    }
    fclose($fp);
If after ob_flush I do a sleep(), I can limit the speed, but I would like to limit at the speed of the parameter. Is there a way to do this? Thanks, Rangel
on average, how big are the files that you will be sending? -- Jim Lucas "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."
Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.0/803 - Release Date: 13/5/2007 12:17


« previous php.general (#255038) next »