Improve company productivity with a Business Account.Sign Up

x
?
Solved

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

Posted on 2008-10-05
5
Medium Priority
?
821 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 1500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

607 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