check for existence of an image on another website and display if there

Posted on 2007-07-24
Last Modified: 2012-06-22
I am want to display images from the MLS on my website.Downloading all the images and then uploading them to my server is a waste of time. Each listing has a different # of photos. The only thing that changes is the subdirectory for each photo.


Is there a to check for the existence of the photo? I tried the following and obviously it was the incorrect approach:

<cfif FileExists("")>
            <img src="" />
Question by:semerj
    LVL 39

    Expert Comment


     FileExists would take the physical directory, not the URL

    So this ..
    <cfif FileExists("")>

    Would be something like this...

    <cfif FileExists("c:\inetpub\wwwroot\san\jpg2\#MLSNum#.jpg")>


    Author Comment

    That won't work, hence my question. The files I am trying to pull are not on the same server as the website where I want to display them.
    LVL 39

    Accepted Solution


    I missed the "image on another website" in the title..

     You can use <cfhttp>  to pull the image over, if its not there, it will return an error code.  


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them ( . I did keep the main js functions but made sever…
    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 …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 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

    23 Experts available now in Live!

    Get 1:1 Help Now