Capturing Request Stream

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

    #1

    Capturing Request Stream

    I would like to capture a request stream before the request has been
    completely sent to the server for the sake of saving the bytes of a posted
    file to disk. I have written httpmodules before, but (correct me if I am
    wrong) it seems that by the ProcessRequest event, the Request has been
    completely sent and aspnet_wp has used it to hydrate the httpcontext
    instance.

    Is there a .net way of capturing an http request as it comes in to the
    server? Do I have to write an httpapplication for this or something? If
    anyone could point me in the right direction ( w/out trying to sell me some
    3rd party assembly ), I would appreciate it.

    ~TIA


  • fzjr4n

    #2
    Re: Capturing Request Stream

    Or you must go through the pain of writing an ISAPI filter...


    --
    MARK TRUDGEON
    fzjr4n@unison.i e

    This posting is provided "as is", with no warranties, and confers no rights.


    "Natty Gur" <natty@dao2com. com> wrote in message
    news:uIZHS6BTDH A.2148@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi,
    >
    > Is the Request.InputSt ream holds that data ?
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 28th Baruch Hirsch st. Bnei-Brak
    > Israel , 51114
    >
    > Phone Numbers:
    > Office: +972-(0)3-5786668
    > Fax: +972-(0)3-5703475
    > Mobile: +972-(0)58-888377
    >
    > Know the overall picture
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    • Steve C. Orr, MCSD

      #3
      Re: Capturing Request Stream

      You can override the Render method of your page object and get the final
      output from there.
      Here's more info:
      http://msdn.microsoft.com/library/de...endertopic.asp

      --
      I hope this helps,
      Steve C. Orr, MCSD



      "PJ" <pjwal@hotmail. com> wrote in message
      news:el2qZ%23$S DHA.3188@tk2msf tngp13.phx.gbl. ..[color=blue]
      > I would like to capture a request stream before the request has been
      > completely sent to the server for the sake of saving the bytes of a posted
      > file to disk. I have written httpmodules before, but (correct me if I am
      > wrong) it seems that by the ProcessRequest event, the Request has been
      > completely sent and aspnet_wp has used it to hydrate the httpcontext
      > instance.
      >
      > Is there a .net way of capturing an http request as it comes in to the
      > server? Do I have to write an httpapplication for this or something? If
      > anyone could point me in the right direction ( w/out trying to sell me[/color]
      some[color=blue]
      > 3rd party assembly ), I would appreciate it.
      >
      > ~TIA
      >
      >[/color]


      Comment

      • PJ

        #4
        Re: Capturing Request Stream

        I'm not trying to get the output stream...I want to get the input stream of
        the Request as it arrives and before it fully arrives so as take byte[]
        chunks of a posted gigabyte file and save them to disk.

        context.Request .Files[0].InputStream

        Can someone tell me if I can get access to the InputStream before the
        request has been fully posted to the server?

        thx

        "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
        news:uZSsCHCTDH A.2120@TK2MSFTN GP11.phx.gbl...[color=blue]
        > You can override the Render method of your page object and get the final
        > output from there.
        > Here's more info:
        >[/color]
        http://msdn.microsoft.com/library/de...endertopic.asp[color=blue]
        >
        > --
        > I hope this helps,
        > Steve C. Orr, MCSD
        > http://Steve.Orr.net
        >
        >
        > "PJ" <pjwal@hotmail. com> wrote in message
        > news:el2qZ%23$S DHA.3188@tk2msf tngp13.phx.gbl. ..[color=green]
        > > I would like to capture a request stream before the request has been
        > > completely sent to the server for the sake of saving the bytes of a[/color][/color]
        posted[color=blue][color=green]
        > > file to disk. I have written httpmodules before, but (correct me if I[/color][/color]
        am[color=blue][color=green]
        > > wrong) it seems that by the ProcessRequest event, the Request has been
        > > completely sent and aspnet_wp has used it to hydrate the httpcontext
        > > instance.
        > >
        > > Is there a .net way of capturing an http request as it comes in to the
        > > server? Do I have to write an httpapplication for this or something?[/color][/color]
        If[color=blue][color=green]
        > > anyone could point me in the right direction ( w/out trying to sell me[/color]
        > some[color=green]
        > > 3rd party assembly ), I would appreciate it.
        > >
        > > ~TIA
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • PJ

          #5
          Re: Capturing Request Stream

          yep, i know it can be done w/ a c++ asapi filter, but i'm pretty sure it can
          be done in managed code as well...

          "fzjr4n" <fzjr4n@unison. ie> wrote in message
          news:eFNqXECTDH A.2120@TK2MSFTN GP11.phx.gbl...[color=blue]
          > Or you must go through the pain of writing an ISAPI filter...
          >
          >
          > --
          > MARK TRUDGEON
          > fzjr4n@unison.i e
          >
          > This posting is provided "as is", with no warranties, and confers no[/color]
          rights.[color=blue]
          >
          >
          > "Natty Gur" <natty@dao2com. com> wrote in message
          > news:uIZHS6BTDH A.2148@TK2MSFTN GP11.phx.gbl...[color=green]
          > > Hi,
          > >
          > > Is the Request.InputSt ream holds that data ?
          > >
          > > Natty Gur, CTO
          > > Dao2Com Ltd.
          > > 28th Baruch Hirsch st. Bnei-Brak
          > > Israel , 51114
          > >
          > > Phone Numbers:
          > > Office: +972-(0)3-5786668
          > > Fax: +972-(0)3-5703475
          > > Mobile: +972-(0)58-888377
          > >
          > > Know the overall picture
          > >
          > >
          > > *** Sent via Developersdex http://www.developersdex.com ***
          > > Don't just participate in USENET...get rewarded for it![/color]
          >
          >[/color]


          Comment

          Working...