I don't know what server you're using, but this is info that is in the logs. The easy way out would be to parse those logs rather than interrupt the otherwise straightforward HTTP process. | [reply] |
It depends on how apache is configured. You may have the general log just log IP, time, and file. You don't want it to have Referer, User-Agent, etc except for the files gotten from FTP. I don't care if you use Linux with Mozilla coming from perlmonks to display a .gif, but I do care if all the people downloading a file have certain things in common. If I find out 50% of people downloading a program are using NT, but my program has a small bug with NT, then I'd probably fix it. Also, what if I have a specific version for NT, for Linux, for 95/98? I don't have to trust the user to download the right one, my script does it for me.
| [reply] |
That would be a case to write in a separate logging function then. But for remote IP, filename, result code, and I believe size, the default Apache log has all of these.
Also, why would you write a HTTP CGI for FTP? Why not just send the file out via HTTP, this alleviates the overhead needed for FTP.
| [reply] |