Solved

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

Posted on 2008-10-05
5
810 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

759 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now