> I want to grab an image which is located on a backend > server and send it to the client browser. In this case, > I can not simple send an <img src="" alt="" border="0"> > tag in an html page (for reasons I can't get into and > you probably do not want to hear about it anyway). > > In this case, I'm using <cfhttp> to get the binary file > (image) from the backend server and using <cfcontent> to > push the binary file to the client browser. Here is the > code in my template: > > Begin getImage.cfm > ------------------------------------------------ > <cfsetting enablecfoutputonly="Yes" showdebugoutput="No" > catchexceptionsbypattern="No"> > > <cfhttp url="http://www.ncsu.edu/design/slides/AccessDenied.gif" > method="GET" resolveurl="false"></cfhttp> > <!--- > <pre> > <cfoutput>#cfhttp.header#</cfoutput><br> > <cfoutput>--'#cfhttp.FileContent#'--</cfoutput> > </pre> > ---> > <cfcontent type="image/gif" > reset="YES"><cfoutput>#cfhttp.FileContent#</cfoutput> > ---------------------------------------------------- > End of getImage.cfm > > Here is an example of a URL that one would use: > http://www.ncsu.edu/design/slides/getImage.cfm/jack.gif > > All I get is a page with an outlined box in place where > the image is to go. I get no image. I'm able to view the > properties when I right click in the area where the image > should be.
I don't think you'll be able to just output CFHTTP.FileContent; that only works if it contains valid string data. Instead, you'll probably have to save the image to file in your CFHTTP tag, then use CFCONTENT to reference the file. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

