Solved

cfhttp to retreive remote image on coldfusion 5

Posted on 2008-06-24
2
458 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now