Run a Virus Scan While Uploading files in ASP.NET

流过昼夜 提交于 2019-12-03 05:50:41

Just purchase antivirus software that has a command-line interface (several popular packages include this). Once the file has been uploaded, run the scan.

I would think, in order to upload and scan at the same time, you might need to implement your own antivirus software as I'm not familiar with any package that would provide that sort of interface.

I run a shareware site. It doesn't work as you described, but I download each file to my local computer and run a scan on them. You would be doing something similar.

First of all the file must be saved onto the server before you can scan it. If you notice Yahoo will upload the file first - but not allow the attachment to be sent until scanned.

Then you can use an antivirus with a command line interface or some other kind of API. Both of these can be called via C# and should provide the functionality you require. Parhaps write a wrapper class that takes a file and returns true or false depending on whether a virus was detected.

OSH

Other applications that provide you with a command line interface:

  1. Microsoft Security Essentials
  2. clamAv

I believe MS AV provides better results.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!