?
Solved

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

Posted on 2008-10-05
5
Medium Priority
?
815 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

762 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