Response.Buffer

  • Thread starter Thread starter PJ
  • Start date Start date
P

PJ

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

Response.BufferOutput = False

or

Response.Buffer = False

or both?

TIA~PJ
 
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()
 
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.
 
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
 
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.
 
Back
Top