Open Pdf Document From Website

June 24, 2009 by admin
Filed under: Newest Projects 

I want to open PDF documents from our website in a window without the file address showing to the user. We had this working on our site before but now moved to a new server and the code stopped working.

The ASP code we used before is below to give you an idea what we are looking for. I can’t imagine that this is a big project but we need someone to fix it for us quickly.

Dim TypeBinary, oStream

Response.ContentType = “application/pdf”
Response.Addheader(“Content-Disposition”, “attachment; filename=” & File)

TypeBinary = 1 ‘ Indicates a binary file

‘ Create the object
Set oStream = Server.CreateObject(“ADODB.Stream”)

‘ Open our file
oStream.Open

‘ Retreive binary data from the file
oStream.Type = TypeBinary

oStream.LoadFromFile Path_To_File

‘ Return the binary data to the caller
Response.BinaryWrite oStream.read

‘ Destroy the ADO object
Set oStream = Nothing

Go to Source

Post similar project on sosexpert.com



Related Projects

Comments

Comments are closed.

Better Tag Cloud
goingup