System.IO.Stream writing binary to users browser

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.
maflatoun [ Di, 29 Januar 2008 02:50 ] [ ID #1918769 ]

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

mazdotnet <maflatoun [at] gmail.com> 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 - <skeet [at] pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
skeet [ Di, 29 Januar 2008 08:27 ] [ ID #1918774 ]

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

On Jan 29, 2:27=A0am, Jon Skeet [C# MVP] <sk... [at] pobox.com> wrote:
> mazdotnet <maflat... [at] gmail.com> 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 - <sk... [at] pobox.com>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.
maflatoun [ Di, 29 Januar 2008 15:31 ] [ ID #1918785 ]
Microsoft » microsoft.public.dotnet.general » System.IO.Stream writing binary to users browser

Vorheriges Thema: [Personalizable(PersonalizationScope.User)]
Nächstes Thema: Custom Action in deployment project