Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

cfhttp to retreive remote image on coldfusion 5

Posted on 2008-06-24
2
Medium Priority
?
474 Views
Last Modified: 2013-12-24
Hi,

I've tried many things, the code attached is where I am now with it. Basically, I am trying retrieve images from a remote server (inside the firewall) for display back. Only the web server outside the firewall is allowed in to get the images.

The only problem is because of support reasons and this running on an archaic CMS I am stuck with only CF5 at my disposal. I've seen examples elsewhere of people doing this but with at least CF 6 or 7.

I have tried it with getasbinary set to "yes" and that doesn't help. Also, Firefox shows the URL of the cfm page as the result and IE shows the familiar image icon with a red "x" in it.

Thanks in advance for any assistance.
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<cfcontent type="image/png; charset=ISO-8859-1">
<cfheader name="Content-Type" value="image/png">
<cfhttp GetAsBinary="yes" url="http://images.domain.com:8080/i/image.png" method="GET"></cfhttp>
<cfoutput>#trim(toString(cfhttp.filecontent))#</cfoutput>

Open in new window

0
Comment
Question by:woaz
2 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 21878949
you are getting an error because the page/image is not being served by the webserver

just put http://images.domain.com:8080/i/image.png into a web browser you get an error, so its not the  code but the url
0
 

Accepted Solution

by:
woaz earned 0 total points
ID: 22010091
Thanks for the reply Jester. Putting the URL in directly doesn't give me the error as long as i'm not on the public network. That is why I was trying to proxy the image by having the webserver in the DMZ make the request to retreive the image. It has

Anyways, I found another solution. I am building the images on the fly and shipping them into a cache folder in the DMZ. A side benefit is improved performance.

Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
What You Need to Know when Searching for a Webhost Provider
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question