Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF binaryWrite garbage!!!

Status
Not open for further replies.

ombina

Programmer
Jun 18, 2002
62
US
Help please. I'm trying to read PDF within browser but I get text garbage.

Code:
<%
Response.Buffer = true
dim objStream

set objStream = server.CreateObject(&quot;ADODB.Stream&quot;)
objStream.Type = 1 'adtypeBinary
objStream.Open
objStream.LoadFromFile(Server.Mappath(&quot;test.pdf&quot;))

Response.Clear
Response.ContentType=&quot;application/pdf&quot;
Response.AddHeader &quot;content-disposition&quot;, &quot;attachment;filename=.pdf&quot;

Response.BinaryWrite objStream.Read
ObjStream.Close : set objStream=nothing
Response.End
%>

Thanks,

Ricky Thanks,

Ricky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top