locked
Virus scanning API and samples RRS feed

  • Question

  • User-853298616 posted

    Hello,

    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

    Thursday, June 11, 2009 4:21 AM

All replies

  • User1571885900 posted

    Hi,

    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.

    Thursday, June 11, 2009 7:03 AM