Re: PHP bandwidth control

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

 




I guess there are multiple ways to engage this problem. It depends how
"deep" you want to log the traffic. If you just want to count the
traffic of each image, video etc you could just wrap up each image and
video to go through php first with file_get_contents() (look in the
php manual there are some examples how to work with this), count how
many bytes of data will be sent out and log this in a database or
however you want to do this.

While it's a good suggestion, don't use file_get_contents because it reads the whole file in to memory.

If you use it on a 200Meg movie, it uses > 200Meg of memory.

Use filesize() to work out the size.

Then use fpassthru to shove the data through.

http://www.php.net/fpassthru

--
Postgresql & php tutorials
http://www.designmagick.com/


--
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