garethhall Posted February 15, 2010 Share Posted February 15, 2010 Hi guys, I need a little information I have written a php app and I occurred to that I need to track the bandwidth that the user is using. I have done a google search and looked through my php books but none of them seems to list anything of that kind. Maybe I am just looking in the wrong places? How can I simple echo the size? Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/ Share on other sites More sharing options...
yozyk Posted February 15, 2010 Share Posted February 15, 2010 firebug -> net tab If output control functions has been used you can get size of output buffer by strlen Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1012431 Share on other sites More sharing options...
garethhall Posted February 15, 2010 Author Share Posted February 15, 2010 well i am going to need to count the size and stores it so hows firebug going to help? Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1012484 Share on other sites More sharing options...
yozyk Posted February 15, 2010 Share Posted February 15, 2010 The firebag can show the result, but not save. Where do you want store page size? Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1012571 Share on other sites More sharing options...
garethhall Posted February 15, 2010 Author Share Posted February 15, 2010 I will add it to a database so I can lock out the user when he has exceeded his data usage. Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1012783 Share on other sites More sharing options...
yozyk Posted February 16, 2010 Share Posted February 16, 2010 What kind of sort is «data»? Is it html pages, images or other? Do you want count each byte of you data? Probably you need track number of downloaded files. Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1013169 Share on other sites More sharing options...
JAY6390 Posted February 16, 2010 Share Posted February 16, 2010 Hi Gareth. You will need to create a script that will dynamically/securely echo out a files contents along with it's meta data to the browser, while logging to your db the filesize using http://uk2.php.net/manual/en/function.filesize.php to get the file size. Personally I wouldnt log the data sent until the user completely downloads a file (since they won't have the complete file without doing so) however you could also update your db in real time (but not adviseable) Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1013175 Share on other sites More sharing options...
fqaisrani Posted February 18, 2010 Share Posted February 18, 2010 garethhall I am also looking for something similar. I am planning to use the following steps saving each page size in db before its delivered to user All the images, CSS files etc details will be saved in DB, and a special parser/code will be used to deliver them to user and on each request, it will increment the user bandwidth in db using perl for uploading so I can provide the upload meter as well as monitor the amount of data being uploaded. even if the page is canceled/closed before the file is completely uploaded, I will be saving the partial file upload size but I got no idea how to log ftp bandwidth. Link to comment https://forums.phpfreaks.com/topic/192102-bandwidth-monitoring/#findComment-1014496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.