Solved

virus scan/risk for file uploads in asp.net 2.0 ( web farm environment)

Posted on 2008-10-05
5
813 Views
Last Modified: 2013-12-11
how to scan for virus while uploading file in asp.net,

this allows me to tell user if virus infected  and if not will upload file(saving file so that user can download it from the application when needed)  on to web server.

I need sample code , so that i can get started on this.

also my application has a webfarm environment how to replicate the uploaded file
on the three servers(geographically divided) to be in sync.

please tell me how to proceed , i am a naive developer

environment: asp.net 2.0, c#, oracle 10g, vstudio 2005
0
Comment
Question by:Swetha_aJaX
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22655490
every virus scanner has a command line utility for scanning files for viruses
have a look at this link as it guides for some anti virus command line arguments, what you can do is load the file to the server directory and then call the anti-virus through process.start with the required command line arguments
http://forum.softwareblaze.com/viewtopic.php?t=127
0
 

Author Comment

by:Swetha_aJaX
ID: 22655560
Hi ragi0017,

your solution partly answers my question , can you please give me more info.

1)where do i need to install the anti-virus software.

2)and how do i know about the command line codes ( will anti virus provider gives them)

3)how can i replicate the file uploaded onto three servers( web farm environment -- to make them in sync)

hope i get a detailed reply

Many Thanks!
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22657061
in a web application scenario i dont think that you can call the antivirus command line to scan the file
in this case you will have to bring the file to the server and then only scan it - it involves a risk but i cannot think of other way solution where you scan the file on the client side

every anti virus gives a command line code to scan the files or directories - for that you need to check the documentation of the antivirus

replicate files to web farm - hard question to answer but you need a tool which monitors folders on the web farm and if some file changes on one machine replicates the same file to other machines on the farm
0
 

Author Comment

by:Swetha_aJaX
ID: 22661131
good to see your reply

now i got some idea , of what can be done ?

but its all like theory - to do  practical , i need some sample code
involving some command line code used.

first we need to save it on a location and then call the dll to scan the file from saved location.

if this has virus init -- user is notified

else need to save it on the actual server location.

can we call file.saveas  twice in the same code?

can you suggest me sample code , to get started?
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 total points
ID: 22665064
find out the command line code to call the antivirus form the documentation or searching through the net
after that you can call the command line from System.Diagnostics.Process.Start
some samples (may be not the best ones but still)
http://blogs.msdn.com/brada/archive/2004/09/20/232002.aspx
http://www.gamedev.net/community/forums/topic.asp?topic_id=452594
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Data organization issue 7 40
Return array 3 21
Trigger C# code inside the SQL Server 6 36
Using sample Autorize.net c# simple example 1 31
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question