I had this code in an old asp.net webform app memoryStream
and close it As a pdf show in response form. I am now working with an asp.net MVC application and trying to do the same thing, but how should I go about showing MemoryStream
as a PDF using MICX ?
Asp.net Webform Code:
Receive a byte array in Private Zero ShowPDF (MemoryStream MS) {Memory Byte [pdf] [] fileArray = ms.ToArray () ; // Send the page to the user page. Response.Catch.SetCatibility (HTTP Cabability No Catch); Page response. Buffer = true; Response.Clear (); Response.ClearContent (); Response.ClearHeaders (); reaction. Chargset = string Empty; Response.ContentType = "Apps / PDF"; Response.AddHeader ("Content Length", fileArray.Length.ToString ()); Response.AddHeader ("content-dispute", "attachment; file name = TID.pdf;"); Response.BinaryWrite (fileArray); Response.Flush (); Response.Close (); } Hold {// and bounce goes dynamite ...}}
here Absolutely a blog post on it:
UPDATE: The last comment on that post answers. Transmission file, you may want to customize the code to use the code, if your PDF is large and you will have a lot of concurrent downloads.
Comments
Post a Comment