ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development
View Poll Results: What level do you rate this at
expert 0 0%
advanced 0 0%
some experience 1 100.00%
beginger 0 0%
Voters: 1. You may not vote on this poll


Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old February 8th, 2004, 07:13 AM
spicy spicy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Gold Coast, Australia
Posts: 75 spicy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 23 m 37 sec
Reputation Power: 5
Question show all images from a folder

Hi,

I am having some troubles where to beging this one. I am searching everywhere to find out how I can display all images contained in a particular folder.

I am creating a portfolio, and only want to be able to just upload the image file to say, the logo's folder, and have that displayed automatically in the protfolio.

I have been doing this by using a database as a midway communicator to tell CF that the image is there.

Is it even possible? Well, we are talking about CF, so what am I saying, of course it is....

Thanks Joe

Reply With Quote
  #2  
Old February 8th, 2004, 02:26 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
Why not use <cfdirectory> to read the contents of the directory, then loop over the results and only output the file if it has .gif or .jpg in the file name?

Reply With Quote
  #3  
Old February 8th, 2004, 04:53 PM
spicy spicy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Gold Coast, Australia
Posts: 75 spicy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 23 m 37 sec
Reputation Power: 5
Talking

Thanks kiteless,

I did have that in mind (well not as clearly as you), but it seems to be on the complex side (I am quiete new to CF). I was hoping that there would be a read and display as image tag or something.

Again, thanks for the advice.

Joe

Reply With Quote
  #4  
Old February 8th, 2004, 09:16 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
Nope, that's about the only way to do it. You could of course write a function or custom tag that you could reuse whenever you need that functionality. Either way, it's actually quite easy and would only take a few lines of code. Something like:

<cfdirectory action="LIST" directory="#getDirectoryFromPath( getTemplatePath() )#/images/" name="directoryData">
<cfoutput query="directoryData">
<cfif findNoCase( '.jpg', directoryData.name ) or findNoCase( '.gif', directoryData.name )>
<img src="images/#directoryData.name#">
</cfif>
</cfoutput>

Obviously substitute your image directory if it differs from what I'm using above.

Reply With Quote
  #5  
Old February 8th, 2004, 09:21 PM
spicy spicy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Gold Coast, Australia
Posts: 75 spicy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 23 m 37 sec
Reputation Power: 5
Your a savior...

I have been trying to work out how to do this, and I now see what I missed out.

I am pretty crappy at coding, but I learn.

Thank you sooo much

Joe

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > show all images from a folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway