What is doing the uploading/downloading (as in server software - this HTTP or FTP?)
For PHP, you'll have to have PHP read the server-your-interested-in's logs.
For anti-leech, you could use PHP to do this with a web server. With FTP you'll have to find an FTP server that supports this or build your own. You can use PHP to build an FTP server, but it would be a bit more overhead on the machine then if the FTP server was built with C/C++ or something.
Basically, we need more input in regards to what you want to do...