Scanning uploads in my asp.net pages

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
 
G

Gaurav Vaish \(www.Edujini-Labs.com\)

You will need to look into the documentation of the antivirus application:

1. Does it provide any API that you can call?
2. Can it monitor a folder for any changes so that you first temporarily
upload it to the corresponding directory and after scanning is done, it can
be moved to final location?
 
T

tshad

Gaurav Vaish (www.Edujini-Labs.com) said:
You will need to look into the documentation of the antivirus application:

1. Does it provide any API that you can call?
2. Can it monitor a folder for any changes so that you first temporarily
upload it to the corresponding directory and after scanning is done, it
can be moved to final location?
1. I have called TrendMicro about this - but no one seems to know. I have
seen quite a few people talking about an API but so far no one seems to know
how it is done. All you see is - you would have get the API from your AV
supplier but not they have done it.

2. I could do that but how would I know if there was a virus in it or not?

Thanks,

Tom
 
G

Gaurav Vaish \(www.Edujini-Labs.com\)

2. I could do that but how would I know if there was a virus in it or not?

Ensure that the action is set to quarantine and delete the file if virus is
found. Both of you - AV and your code - monitor the directory. If AV deletes
the file after scanning, it had virus.


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujinionline.com
-----------------------------------------
 
T

tshad

Gaurav Vaish (www.Edujini-Labs.com) said:
Ensure that the action is set to quarantine and delete the file if virus
is found. Both of you - AV and your code - monitor the directory. If AV
deletes the file after scanning, it had virus.

That is exactly what I am going to have to do.

I did find out that Office Scan was deleting the file if it had a virus. So
I can do as you suggest. When the file uploaded - I then check to see if
the file is there. It turns out that there is a log I can look at to see if
the filename is there. If it is, it was quarantined. It took a while to
find this file but I did find it. Tech support didn't know about the file.
I had to show it to them. Their solution was to look at the logs from their
Master Console. This was not an option either as that would involve someone
looking at it periodically and not via my program.

I don't know about any API - other that a command line option where you have
to stop the real time scanner to use it. Not an option.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top