I'm using mx6.1 as well...


I took the binary data and pasted it into a file and saved with .pdf
extension.. tired to open it and got "The file is damaged and could not be
repaired."  Sometimes the browser would prompt and sometimes it would just
display the binary data.

-----Original Message-----
From: Jeff Beer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 2:42 PM
To: CF-Talk
Subject: RE: Using cfhttp to display pdf file

Are you using cf5?  I could not make it work on CF5, but it works like a
charm on CFMX (6.1):

<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<cfhttp GetAsBinary="yes" url=""> method="GET"></cfhttp>
<cfcontent
type="application/pdf"><cfoutput>#trim(toString(cfhttp.filecontent))#</c
foutput>

> -----Original Message-----
> From: Tim Do [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 18, 2003 5:00 PM
> To: CF-Talk
> Subject: RE: Using cfhttp to display pdf file
>
>
> I saw that earlier.. but that didn't work for me either...
> running out of ideas =(
>  
>  <cfhttp
> url=""> > /2010AgingDeta
> il_200310.pdf
> <https://inview.wng.com/investor/resource/2010/AgingDetail/201
> 0AgingDetail_2
> 00310.pdf> "  
>           method="GET" getAsBinary="yes">  
>     </cfhttp>
>     <cfcontent type="application/pdf">
>  <cfoutput>#ToString (cfhttp.filecontent)#</cfoutput>
>  
>  
>
> -----Original Message-----
> From: Dave Carabetta [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 18, 2003 1:55 PM
> To: CF-Talk
> Subject: RE: Using cfhttp to display pdf file
>
>
> >Thanks Dave,
> >
> >But now I'm getting this error:
> >
> >coldfusion.runtime.Cast$ComplexByteArrayException: ByteArray objects
> >cannot be converted to strings.
> >
>
> Actually, a quick read of the LiveDocs stuff might solve
> this. Try putting:
>
> <cfoutput>#toString(cfhttp.fileContent)#</cfoutput>
>
> when using the getAsBinary attribute. From the LiveDocs:
>
> "If ColdFusion does not recognize the body as text and
> converts it to an
> object, but the body consists of text, the cfoutput tag can
> display it. The
> cfoutput tag cannot display Binary type data. (To convert
> binary data to
> text, use the ToString function.)"
>
> That last sentence is where the idea came from. Give it a
> shot. It just
> worked in my application code where I was having trouble before.
>
> Regards,
> Dave.
>
>
>   _____  
>
>
>
  _____  


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

Reply via email to