Skip to main content
Inspiring
September 17, 2019
Question

Images not displaying from folder

  • September 17, 2019
  • 2 replies
  • 240 views

i'm getting no images at all whenever is try to display images to the browser from a folder from my local computer. Below is the code that i'm using:

 

<cfset webpath2 = "C:\ColdFusion2016\cfusion\wwwroot\The_Resolving_Door\photos\#cookie.communityID#\">

<!---the #cookie.communityID# is the name of the folder that matches the ID of the current saved cookie--->

<!---output-images--->

<cfdirectory action="LIST" directory="#getDirectoryFromPath(expandPath('*\photos\#cookie.communityID#\*'))#" filter="*.JPG" name="dir">
<cfloop query="dir">

<cfif dir.type is "file">

<!--- <div> --->

<cfoutput>

<a href="#dir.name#">

   <img src="#dir.name#" width="50">

</a>

</cfoutput>

<!--- </div> --->

</cfif>

</cfloop>

 

Could i be doing something in error as a reason for my images not displaying. The images are in the actual folder but nothing is displaying? Thanks for any insight...

 

 

    This topic has been closed for replies.

    2 replies

    Inspiring
    September 22, 2019

    Thank you! I saw what the issue was by doing the cfdump..

    Charlie Arehart
    Community Expert
    Community Expert
    September 17, 2019

    Try doing a cfdump of your dir and cookie.communityid variables, to make sure their values are what you are expecting. 

    /Charlie (troubleshooter, carehart. org)