Re: Virus scanning for dynamically uploaded files
Sunday, December 1, 2002 11:10 PM
You could allow files to be first uploaded to temp location, start the virus scan for that particular file, read results and if they look good move the file to its proper location. Problem is how to start a virus scan for a specified file and then understand whether or not the file was infected. The answer to both lies in what virus scan you want to use - whether it provides hooks for programmatic execution using java/native code, what is the format in which it provides the scan report. A very crude approach can be to use Runtime.exec to start the virus scan for that file (assuming you can pass the file name as an argument) and read the inout stream from the Process to see what happened...pretty crude...