Last post Jun 11, 2009 07:03 AM by paaresh
Jun 11, 2009 04:21 AM|asrfarinha|LINK
I'm building a web application in C# and I need to scan users' uploaded files for viruses. Can anyone provide pointers to how it should be done, available APIs and sample code for doing it?
Thanks in advance
Jun 11, 2009 07:03 AM|paaresh|LINK
some Antivirus provides command line scanning utility. which takes files name with path as argument and scans provided file. and provides some output or need to check its log file. whether the virus found or not.
for this first you need to save the uploading file. i don't have any idea about scan without saving file. i think it will not be possible because if file does not exists what will be scanned by Antivirus scanner.
after uploading file. just start Antivirus scanner and scan the uploaded file. and check output or Logfile. if virus found file will be deleted by Antivirus (if it is configured such to do), or manually delete it. You can also prompt user about it.
please refer this post http://forums.asp.net/p/890935/956276.aspx#956276
some code is given here.