Reputation: 218782
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?
Upvotes: 0
Views: 3175
Reputation: 48949
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.
Upvotes: 1