PJ
Wed Jul 23 14:18:43 CDT 2003
I don't understand what you're saying, I don't have to buffer the whole file
at all. The Content-Length header is the length of the content only, not
the whole response including the headers. The fs.Length property gives me
the value for that header w/out buffering the whole file.
"Jon Skeet" <skeet@pobox.com> wrote in message
news:MPG.198840a8d5c5df0b98a1af@news.microsoft.com...
> PJ <pjwal@hotmail.com> wrote:
> > > Because for almost all the time, that's actually what you want. At
> > > least, it's almost always what *I* want :)
> >
> > It occurred to me that maybe it sounds like I'm trying to write a virus,
> > lol. The reason I need to do this is that I am compressing a set of
files
> > and then sending it out to an HTTP response stream. I was sending the
> > compressed bytes directly to the stream as the compression was taking
> > place.....but w/out the compression being complete, I have no way of
setting
> > the Content-Length header, so the d/l dialog box does not show a %
> > completion ( unnacceptable I'm told ).
>
> In that case, given that effectively you've *got* to buffer the whole
> thing anyway, you could just write to a MemoryStream first, find the
> length of that, and then dump the contents of the memory stream to the
> real response.
>
> --
> Jon Skeet - <skeet@pobox.com>
>
http://www.pobox.com/~skeet/
> If replying to the group, please do not mail me too