clamscan is a nifty C program that helps you prevent viruses from being placed on your server. It’s a bit like many of the commercial offerings in that it must be educated with various files in order to know how to find a virus in some random binary file. But clamscan is open source and runs as a daemon process. It’s fast. It loads all the virus patterns into RAM at startup and then races through its checks at any time.
Here is a link to an Eclipse workspace for WebObjects that shows you how it works. It’s a simple "File Dump" type of application (like RapidShare):