Writing to users browser (system.io.stream outputstream)

M

mazdotnet

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();
 
M

Mark Fitzpatrick

You would use Response.Outputstream when using the SaveAs to output it to
the browser through the response object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top