I have ASP.NET code that retrieves a PDF file from a database and gives it to the user to download in their browser. I want to make the PDF render inside the browser, without them having to manually open the downloaded file. What's the best approach to do that? My current code is below for reference.
Response.Clear()
Response.AddHeader("Content-Length", fileContents.Length.ToString())
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
Response.OutputStream.Write(fileContents, 0, fileContents.Length)
Response.Flush()
Response.End()