Thanks Dave,


But now I'm getting this error:


coldfusion.runtime.Cast$ComplexByteArrayException: ByteArray objects cannot
be converted to strings.

-----Original Message-----
From: Dave Carabetta [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 12:53 PM
To: CF-Talk
Subject: Re: Using cfhttp to display pdf file

>I'm trying to retrieve a pdf file that is from a virtual directory on the
>webserver using cfhttp... can anybody tell me what I'm doing wrong?  All
>I'm
>getting back is something that starts out like this:
>
>%PDF-1.2 %âÓ 6 0 obj << /Linearized 1 /O 8 /H [ 997 192 ] /L 11898 /E
>9167
>/N 2 /T 11661 >> endobj xref 6 30 0000000016 00000 n 0000000944 00000 n
>0000001189 00000 n 0000001394 00000 n 0000001552 00000 n 0000001732 00000 n
>0000002074 00000 n 0000002253 00000 n 0000002274 00000 n 0000003107 00000 n
>0000003295
>
>here is my code:
>
>  <cfhttp
>url=""> a
>il_200310.pdf
><https://inview.wng.com/investor/resource/2010/AgingDetail/2010AgingDetail_
2
>00310.pdf> "
>           method="GET" resolveurl="YES">
>     </cfhttp>
>     <cfcontent type="application/pdf">
>  <cfoutput>
>   #cfhttp.fileContent#
>  </cfoutput>
>

2 things:

1. If using CFMX 6.1, use the getAsBinary="yes" setting on the cfhttp call
(see LiveDocs for more info)
2. Your output should be:

<cfoutput>#cfhttp.filecontent#</cfoutput>

Note that the the cfhttp.filecontent *must* be on the same line as the
opening cfoutput, or else there will be a line of whitespace at the top of
your page that will cause the PDF output to break.

Hopefully one if, not both, of the above resolve your problem.

Regards,
Dave.

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to