Created
April 17, 2013 14:17
-
-
Save TheTfactor/5404644 to your computer and use it in GitHub Desktop.
PDF display options. Prevents autodownloading.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpContext.Current.Response.BufferOutput = true; | |
HttpContext.Current.Response.ClearContent(); | |
HttpContext.Current.Response.ClearHeaders(); | |
HttpContext.Current.Response.AddHeader("Cache-control", "no-store"); | |
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=\"" + fileName + "\""); | |
HttpContext.Current.Response.ContentType = dr["MimeType"].ToString(); | |
HttpContext.Current.Response.AddHeader("Content-Length", fileblob.Length.ToString()); | |
HttpContext.Current.Response.BinaryWrite(fileblob); | |
HttpContext.Current.Response.Flush(); | |
HttpContext.Current.ApplicationInstance.CompleteRequest(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment