joined:June 10, 2008
I'm trying to actually display a pdf file on a web page. However, everything I've tried always prompts for a download. Does anyone have any idea how to do this? This is what I have been trying.
Dim MyFileStream = New FileStream(Server.MapPath("test.pdf"), FileMode.Open, FileAccess.Read)
Dim FileSize = MyFileStream.Length
Dim Buffer() As Byte
ReDim Preserve Buffer(CInt(FileSize - 1))
MyFileStream.Read(Buffer, 0, CInt(FileSize - 1))
Response.BufferOutput = True
Response.ContentType = "application/pdf"