How can I run a virus scan on files in VB.NET before storing them in SQL Server 2005 database?
-
10-10-2019 - |
Question
I want to upload media and textual files inside the database for my personal use. I have been successful in adding all the files to the database, but I want to scan each file for viruses before uploading it into the database so that a infected file could not be stored inside the database.
How would I scan a file for viruses before upload in VB.NET?
Solution
Use System.Diagnostics.Process and start a command-line anti-virus program, such as clam-av.
Of course, that means you need to save the file in a temporary directory first.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow