Scanning uploads in my asp.net pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    Scanning uploads in my asp.net pages

    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:20 0px" type="File"
    runat="Server">

    I then get the file and then do a:

    MyFile.PostedFi le.SaveAs(PathF ileOut)

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

    Thanks,

    Tom


  • =?Utf-8?B?WE9S?=

    #2
    RE: Scanning uploads in my asp.net pages

    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.

    ??

    Comment

    • ForrestPhoto@gmail.com

      #3
      Re: Scanning uploads in my asp.net pages

      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.

      Comment

      • Laurent Bugnion [MVP]

        #4
        Re: Scanning uploads in my asp.net pages

        Hi,

        tshad wrote:
        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:20 0px" type="File"
        runat="Server">
        >
        I then get the file and then do a:
        >
        MyFile.PostedFi le.SaveAs(PathF ileOut)
        >
        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.publi c.dotnet.framew ork.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
        --
        Laurent Bugnion [MVP ASP.NET]
        Software engineering: http://www.galasoft-LB.ch
        PhotoAlbum: http://www.galasoft-LB.ch/pictures
        Support children in Calcutta: http://www.calcutta-espoir.ch

        Comment

        • Michael Nemtsev

          #5
          Re: Scanning uploads in my asp.net pages

          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

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

          ---
          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


          Comment

          Working...