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


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

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

    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?



    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com


    -----------------------------------------


    "tshad" <tscheiderich@f tsolutions.comw rote in message
    news:eS7coQFNHH A.3268@TK2MSFTN GP04.phx.gbl...
    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
    >
    >

    Comment

    • tshad

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

      "Gaurav Vaish (www.Edujini-Labs.com)" <gaurav.vaish.n ospam@nospam.gm ail.com>
      wrote in message news:OUZJiXLNHH A.1008@TK2MSFTN GP06.phx.gbl...
      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
      >
      >
      --
      Happy Hacking,
      Gaurav Vaish | www.mastergaurav.com


      -----------------------------------------
      >
      >
      "tshad" <tscheiderich@f tsolutions.comw rote in message
      news:eS7coQFNHH A.3268@TK2MSFTN GP04.phx.gbl...
      >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.PostedF ile.SaveAs(Path FileOut)
      >>
      >But I want to do a Virus Scan before I do this. We are using Trend Micro
      >at the moment.
      >>
      >Thanks,
      >>
      >Tom
      >>
      >>
      >
      >

      Comment

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

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

        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


        -----------------------------------------


        Comment

        • tshad

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

          "Gaurav Vaish (www.Edujini-Labs.com)" <gaurav.vaish.n ospam@nospam.gm ail.com>
          wrote in message news:uBA8cZTNHH A.3288@TK2MSFTN GP03.phx.gbl...
          >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.
          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
          >
          >
          --
          Happy Hacking,
          Gaurav Vaish | www.mastergaurav.com


          -----------------------------------------
          >
          >

          Comment

          Working...