System.IO.Stream writing binary to users browser

System.IO.Stream writing binary to users browser

am 29.01.2008 02:50:40 von maflatoun

Hi all,

I'm trying to integrate a third party library that would parse an
excel file and allows us to make changes to. Once I update the
appropriate cells, I want to allow my users to download the modified
file.

It works by
IWorkbook book =
NativeExcel.Factory.OpenWorkbook(this.MapPath(FileName));
... I do all my modifications here
book.SaveAs(where one of the options is System.IO.Stream outputstream)

Now if I want to allow users to download this file, how would use the
System.IO.Stream in the following context?

Response.AddHeader("content-disposition", "attachment; filename=
\"myfile.xls\"");

// here

Response.Flush();
Response.End();

Thank you
Maz.

Re: System.IO.Stream writing binary to users browser

am 29.01.2008 08:27:21 von skeet

mazdotnet wrote:
> I'm trying to integrate a third party library that would parse an
> excel file and allows us to make changes to. Once I update the
> appropriate cells, I want to allow my users to download the modified
> file.

Use Response.OutputStream.

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: System.IO.Stream writing binary to users browser

am 29.01.2008 15:31:20 von maflatoun

On Jan 29, 2:27=A0am, Jon Skeet [C# MVP] wrote:
> mazdotnet wrote:
> > I'm trying to integrate a third party library that would parse an
> > excel file and allows us to make changes to. Once I update the
> > appropriate cells, I want to allow my users to download the modified
> > file.
>
> Use Response.OutputStream.
>
> --
> Jon Skeet - http://www.pobox.com/~skeet=A0 Blog:http://ww=
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

Thanks :).. I figure it out 10 minutes after posting this message.

Maz.