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

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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 18th, 2004, 06:39 PM
peterswan peterswan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Los Angeles, CA
Posts: 32 peterswan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 24 m 57 sec
Reputation Power: 5
Smile loop through all files in a folder

Hello,

Is there a way in ColdFusion to loop through all the files in a folder and drop some links on a page according to what's there?

I've got a bunch of Excel pages and would love to be able to create a page that automatically links to them.

Thanks,



Peter

Reply With Quote
  #2  
Old May 18th, 2004, 10:34 PM
kaasu kaasu is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 58 kaasu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 1 m 4 sec
Reputation Power: 5
You have to use <cfdirectory action="list"> tags. See documentation for the tag description or else you can look in developer exchange for some custom tags

Reply With Quote
  #3  
Old May 18th, 2004, 11:49 PM
Alas's Avatar
Alas Alas is offline
Wickedwd.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: wickedwd.com
Posts: 182 Alas Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 16 h 41 m 17 sec
Reputation Power: 0
Lightbulb Solution wickedwd.com style

I'm not sure what you want to do, plus it's late and i'm tired, plus i've got a Final tomorrow and i should be studying instead of helping you, but i'm sure there will be a time when you help me in return. If not well then all i can say is

This should get u started

Code:
<CFQUERY NAME="Exceltables" DATASOURCE="YourDatabaseName">
SELECT TableID, Column Name1, Column Name 2, etc.
FROM Table Name
ORDER BY Whatever you want
</CFQUERY>

<!--- Provided by Alas from Wickedwd.com --->
<!--- You're a dork if u erase my name --->
<HTML>
<HEAD>
    <TITLE>Excel Tables and such</TITLE>
</HEAD>

<BODY>

<TABLE>
<TR>

<!--- remeber the TableID column is your primary key in the DB --->
<CFOUTPUT QUERY="Exceltables">
<TR>
 <TD>
  <B><A HREF="Pagewheretablesareat.cfm?TableID=#URLEncodedFormat(Trim(TableID))#">#ColumnName1 or 2, whatever#</A></B>
 </TD>
</CFOUTPUT>
</TABLE>

</BODY>
</HTML>


Ps hope this helps, im off to study.

Check u later,
Alas

Reply With Quote
  #4  
Old May 19th, 2004, 08:18 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,488 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 18 h 10 m 11 sec
Reputation Power: 42
I think the question was directed more at reading files from a directory, not a database. If this is indeed the case, then using <cfdirectory> is the best route.

Reply With Quote
  #5  
Old May 19th, 2004, 08:53 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 24th Plane (16500 - 16999 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 16,743 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 2 Days 21 h 15 m 47 sec
Reputation Power: 870
yeah, it's pretty easy, here's my version
Code:
<CFDIRECTORY NAME="myfiles"
  DIRECTORY="#ExpandPath('.')#" 
  FILTER="*.*m*"
  SORT="DateLastModified DESC">

<h3>My Files</h3>
<p><CFOUTPUT QUERY="myfiles">
#myfiles.DateLastModified# <a href="#myfiles.Name#">#myfiles.Name#</a><br />
</CFOUTPUT></p>
this cfm sits inside the folder (the DIRECTORY parameter indicates the current folder) and reports only what's inside it (the HREF is relative)

the filter pulls out only .*m* file extensions, e.g. .cfm, .htm, .html
__________________
r937.com | rudy.ca

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > loop through all files in 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 5 hosted by Hostway