views:

96

answers:

1

in VB.NET How can i write a memory stream to browser.My memory stream object has data to build a PDF file.Now i want it to be rendered on browser.How to do that ? Thanks in advance

+1  A: 

You could try something like:

Dim stream As MemoryStream = GetMemoryStream()
Response.Clear()
Response.ContentType = "application/pdf"
Response.AddHeader("Content-Disposition", "attachment; filename=yourfile.pdf")
Response.Write(stream.ToArray())
Response.End()

I have not tested the code nor am I sure of the mime type, but this should get you started.

Brian Gideon