Portal Home > Knowledgebase > Articles Database > limiting download speed in php


limiting download speed in php




Posted by Arber, 02-19-2010, 04:46 PM
Lets say if I have: header("Content-Disposition: attachment; filename=$name"); header("Content-type: application/rar;\r\n"); readfile(str_replace(' ', '%20', $link)); and I want to limit the download speed of that? How would this be possible?

Posted by mattle, 02-19-2010, 05:31 PM
this looks promising: http://www.jonasjohn.de/snippets/php/dl-speed-limit.htm

Posted by Arber, 02-19-2010, 06:02 PM
I tried that but it only does 600bytes /sec

Posted by mattle, 02-19-2010, 07:02 PM
Is that good or bad? You never specified the download speed you want to achieve... It should be pretty easy to adjust the speed in that script...

Posted by Arber, 02-19-2010, 07:07 PM
I set it to 100kb/s and it went 600bytes/second. Please note its getting a file from a different server then sending it to the user



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Amazon EC2 Full? (Views: 666)

Language: