Response.Buffer

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

    #1

    Response.Buffer

    When streaming a file attachment to the response stream, should I set

    Response.Buffer Output = False

    or

    Response.Buffer = False

    or both?

    TIA~PJ


  • Steve C. Orr, MCSD

    #2
    Re: Response.Buffer

    Neither are necessary.

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



    "PJ" <pjwal@hotmail. com> wrote in message
    news:%23BxjVeHU DHA.1280@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > When streaming a file attachment to the response stream, should I set
    >
    > Response.Buffer Output = False
    >
    > or
    >
    > Response.Buffer = False
    >
    > or both?
    >
    > TIA~PJ
    >
    >[/color]


    Comment

    • PJ

      #3
      Re: Response.Buffer

      Do you mean: Neither or necessary if you Flush the stream every time in the
      loop?

      Also, are one or both of these methods needed...
      Response.Close( )
      Response.End()

      "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
      news:%239i$QgHU DHA.2420@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > Neither are necessary.
      >
      > --
      > I hope this helps,
      > Steve C. Orr, MCSD
      > http://Steve.Orr.net
      >
      >
      > "PJ" <pjwal@hotmail. com> wrote in message
      > news:%23BxjVeHU DHA.1280@TK2MSF TNGP12.phx.gbl. ..[color=green]
      > > When streaming a file attachment to the response stream, should I set
      > >
      > > Response.Buffer Output = False
      > >
      > > or
      > >
      > > Response.Buffer = False
      > >
      > > or both?
      > >
      > > TIA~PJ
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Steve C. Orr, MCSD

        #4
        Re: Response.Buffer

        If you are streaming a single file through your page, and you haven't output
        any HTML in this page, then none of the statements you've mentioned are
        necessary for the file download to be successful.

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



        "PJ" <pjwal@hotmail. com> wrote in message
        news:evj6fGIUDH A.2520@tk2msftn gp13.phx.gbl...[color=blue]
        > Do you mean: Neither or necessary if you Flush the stream every time in[/color]
        the[color=blue]
        > loop?
        >
        > Also, are one or both of these methods needed...
        > Response.Close( )
        > Response.End()
        >
        > "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
        > news:%239i$QgHU DHA.2420@TK2MSF TNGP10.phx.gbl. ..[color=green]
        > > Neither are necessary.
        > >
        > > --
        > > I hope this helps,
        > > Steve C. Orr, MCSD
        > > http://Steve.Orr.net
        > >
        > >
        > > "PJ" <pjwal@hotmail. com> wrote in message
        > > news:%23BxjVeHU DHA.1280@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
        > > > When streaming a file attachment to the response stream, should I set
        > > >
        > > > Response.Buffer Output = False
        > > >
        > > > or
        > > >
        > > > Response.Buffer = False
        > > >
        > > > or both?
        > > >
        > > > TIA~PJ
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • PJ

          #5
          Re: Response.Buffer

          you appear correct w/ the .Buffer and End properties (as long as i set the
          Content-Length header), but if i don't call .Flush() in the loop, then
          asp.net will buffer the entire response in memory before the open/save
          dialog box appears on the client. this is no good for the large file
          downloads we have to


          "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
          news:%23oHXbUKU DHA.2116@TK2MSF TNGP12.phx.gbl. ..[color=blue]
          > If you are streaming a single file through your page, and you haven't[/color]
          output[color=blue]
          > any HTML in this page, then none of the statements you've mentioned are
          > necessary for the file download to be successful.
          >
          > --
          > I hope this helps,
          > Steve C. Orr, MCSD
          > http://Steve.Orr.net
          >
          >
          > "PJ" <pjwal@hotmail. com> wrote in message
          > news:evj6fGIUDH A.2520@tk2msftn gp13.phx.gbl...[color=green]
          > > Do you mean: Neither or necessary if you Flush the stream every time in[/color]
          > the[color=green]
          > > loop?
          > >
          > > Also, are one or both of these methods needed...
          > > Response.Close( )
          > > Response.End()
          > >
          > > "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
          > > news:%239i$QgHU DHA.2420@TK2MSF TNGP10.phx.gbl. ..[color=darkred]
          > > > Neither are necessary.
          > > >
          > > > --
          > > > I hope this helps,
          > > > Steve C. Orr, MCSD
          > > > http://Steve.Orr.net
          > > >
          > > >
          > > > "PJ" <pjwal@hotmail. com> wrote in message
          > > > news:%23BxjVeHU DHA.1280@TK2MSF TNGP12.phx.gbl. ..
          > > > > When streaming a file attachment to the response stream, should I[/color][/color][/color]
          set[color=blue][color=green][color=darkred]
          > > > >
          > > > > Response.Buffer Output = False
          > > > >
          > > > > or
          > > > >
          > > > > Response.Buffer = False
          > > > >
          > > > > or both?
          > > > >
          > > > > TIA~PJ
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Steve C. Orr, MCSD

            #6
            Re: Response.Buffer

            Right, the methods exist mostly for performance reasons. They can improve
            performance and scalability in certain situations such as the one you've
            mentioned. But they are not necessary; they are optimizations.

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



            "PJ" <pjwal@hotmail. com> wrote in message
            news:OQlYPdLUDH A.1364@TK2MSFTN GP10.phx.gbl...[color=blue]
            > you appear correct w/ the .Buffer and End properties (as long as i set the
            > Content-Length header), but if i don't call .Flush() in the loop, then
            > asp.net will buffer the entire response in memory before the open/save
            > dialog box appears on the client. this is no good for the large file
            > downloads we have to
            >
            >
            > "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
            > news:%23oHXbUKU DHA.2116@TK2MSF TNGP12.phx.gbl. ..[color=green]
            > > If you are streaming a single file through your page, and you haven't[/color]
            > output[color=green]
            > > any HTML in this page, then none of the statements you've mentioned are
            > > necessary for the file download to be successful.
            > >
            > > --
            > > I hope this helps,
            > > Steve C. Orr, MCSD
            > > http://Steve.Orr.net
            > >
            > >
            > > "PJ" <pjwal@hotmail. com> wrote in message
            > > news:evj6fGIUDH A.2520@tk2msftn gp13.phx.gbl...[color=darkred]
            > > > Do you mean: Neither or necessary if you Flush the stream every time[/color][/color][/color]
            in[color=blue][color=green]
            > > the[color=darkred]
            > > > loop?
            > > >
            > > > Also, are one or both of these methods needed...
            > > > Response.Close( )
            > > > Response.End()
            > > >
            > > > "Steve C. Orr, MCSD" <Steve@Orr.ne t> wrote in message
            > > > news:%239i$QgHU DHA.2420@TK2MSF TNGP10.phx.gbl. ..
            > > > > Neither are necessary.
            > > > >
            > > > > --
            > > > > I hope this helps,
            > > > > Steve C. Orr, MCSD
            > > > > http://Steve.Orr.net
            > > > >
            > > > >
            > > > > "PJ" <pjwal@hotmail. com> wrote in message
            > > > > news:%23BxjVeHU DHA.1280@TK2MSF TNGP12.phx.gbl. ..
            > > > > > When streaming a file attachment to the response stream, should I[/color][/color]
            > set[color=green][color=darkred]
            > > > > >
            > > > > > Response.Buffer Output = False
            > > > > >
            > > > > > or
            > > > > >
            > > > > > Response.Buffer = False
            > > > > >
            > > > > > or both?
            > > > > >
            > > > > > TIA~PJ
            > > > > >
            > > > > >
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            Working...