Show a pdf file on the page
Hi, I want to show a pdf on the page, but it always promts me to open or save the file, I'm using the following code:
Dim fs As FileStream
fs = New System.IO.FileStream("file.pdf", FileMode.Open, FileAccess.Read)
Dim Buffer(fs.Length) As Byte
fs.Read(Buffer, 0, CInt(fs.Length))
fs.Close()
Response.BufferOutput = True
Response.ClearContent()
Response.ClearHeaders()
Response.AddHeader("Content-Length", Buffer.Length.ToString)
Response.AddHeader("content-disposition", "inline")
Response.ContentType = "application/pdf"
Response.BinaryWrite(Buffer)
Response.Flush()
Response.End()
What's wrong with that code, I'm using aspx 1.1 thanks for you help!!!
|