Scanning uploads in my asp.net pages

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

We have a few pages that accept uploads and want to scan the files before
accepting them. Does Asp.net have a way of doing a virus scan?

We are using Trendmicro to scan files and email but don't know if we can use
it with our pages to handle files that our clients upload. Is there some
type of API that would allow us to do this?

I want to be able to Upload Word files using:

<input id="MyFile" visible="true" style="width:200px" type="File"
runat="Server">

I then get the file and then do a:

MyFile.PostedFile.SaveAs(PathFileOut)

But I want to do a Virus Scan before I do this. We are using Trend Micro at
the moment.

Thanks,

Tom
 
all that I can suggest is that you save it to a 'safe' place somewhere, have
the realtime monitor then scan the file. after a scan is done (u may have to
read the virus scanner event log or something) then move ur file to where u
want it.

??
 
Probably not. The .net framework ships with compression, encryption,
and other goodies, but if virus scanning was part of the package, and
new viruses ( virii? ) are being written every day ... that's why all
the AV software is subscription based.

I don't think you can hurt your server by saving a file to it ( esp if
Word isn't installed on it ), so you could leave that up to the client.
 
Hi,
We have a few pages that accept uploads and want to scan the files before
accepting them. Does Asp.net have a way of doing a virus scan?

We are using Trendmicro to scan files and email but don't know if we can use
it with our pages to handle files that our clients upload. Is there some
type of API that would allow us to do this?

I want to be able to Upload Word files using:

<input id="MyFile" visible="true" style="width:200px" type="File"
runat="Server">

I then get the file and then do a:

MyFile.PostedFile.SaveAs(PathFileOut)

But I want to do a Virus Scan before I do this. We are using Trend Micro at
the moment.

Thanks,

Tom

ASP.NET questions are better posted to the
microsoft.public.dotnet.framework.aspnet newsgroup.

Also, Google is your friend in that case. A simple Google search with
the words "upload asp.net virus scan" returns quite a few hits...

In short: If you are sure that the server has a virus scanner installed,
and if the virus scanner is configured correctly, the file will be
scanned when it is saved. This is not different from copying a file from
a CD to the HDD, for example.

There are also ways to scan the file "in memory", but I don't think it's
needed in your case.

HTH,
Laurent
 
Hello tshad,

To add to other repliers I'd suggest to look for the VirusScan web services
to process your scanning before upload.
AFAIK Kaspersky Lab provide such a service http://www.kaspersky.com/scanforvirus
Google to find out more

t> We have a few pages that accept uploads and want to scan the files
t> before accepting them. Does Asp.net have a way of doing a virus
t> scan?

---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
Back
Top