----- Original Message -----
Sent: Tuesday, March 26, 2002 4:39
PM
Subject: RE: [CFTALKTor]
CFdirectory
For
what it's worth CFOUTPUT supposedly loops faster on queries than CFLOOP. Also,
I don't know how many files you have in that directory, but that might be the
problem, if you have a lot of files, CFDIRECTORY has to list all of them just
to show 20....
If
all your files are numbered sequentially, why not just do a LOOP from 1 to 20
? It would certainly be faster. For checking purposes you could use the
fileExists() function. That's if all files follow a naming convention. You
could use something like:
curPos = 1;
maxPos = 20;
while ( curPos LTE maxPos ) {
if ( fileExists( curPos & ".html" )
)
writeOutput( "<option....>#curPos#</option....>" );
curPos = curPos + 1;
}
Otherwise, you might want to insert the files or just the files names
in a database and list them from there...
Marc
Hi Bob
This is the Code I am using.
<cfdirectory action="LIST"
directory="server/#directory#" name="repdir" sort="name DESC"
filter="*.html">
<form name="report" method="post"
action="display.cfm" target="_blank">
<input type="Hidden"
name="directory"
value="<cfoutput>#directory#</cfoutput>">
<select
name="filename">
<cfset var1 = "_">
<cfset
var2 = " ">
<cfset var3 =
".html">
<cfoutput>
<cfloop
query="repdir" startrow="1" endrow="20">
<cfset
dispname = #RemoveChars(repdir.name, 1,
6)#>
<cfset dispnamefinal = #replace(dispname,
var3, var2)#>
<option
value="#name#">#Replace(dispnamefinal, var1, var2,
"all")#</option>
<!--- <input type="Hidden"
name="dispnamefinal" value="#dispnamefinal#">
--->
</cfloop>
</cfoutput>
The HTML documents are generated using Excel,
there is tons of code but if you view them via the url they load fine.
Intermedia asked me to stop using this function as it is taxing the
CPU.
Mike
----- Original Message -----
Sent: Tuesday, March 26, 2002 3:16
PM
Subject: Re: [CFTALKTor]
CFdirectory
I haven't heard of that problem before.
Are you using a filter for your directory listing? That might
improve performance. Do you have control over the creation of these
html files? If so, perhaps you could add an entry to a table
whenever a file is created. One other idea, but I imagine it would
perform much worse that CFDirectory, would be to write a batch file that
does a directory listing and pipes it to a file. You could use
CFEXECUTE to run the batch file and CFFILE to read it, but that is really
just an insane workaround. You really should be able to use
CFDIRECTORY.
Do the hosts tell you that you shouldn't be
using CFDIRECTORY?
Bob
----- Original Message -----
Sent: Wednesday, March 27, 2002
8:00 AM
Subject: [CFTALKTor]
CFdirectory
Hello All,
I am having a problem with my hosting
company (intermedia) while using CFDirectory. I have a small
application that reads html files that are created using excel and then
send via FTP to a particular directory i.e. 1.html, 2.html
etc.
These files are then shown in a combo box
and launch in a new window. I am getting timeouts and server
errors. Intermedia says that the CPU is peaking when ever I place
a request like this.
I thought that intermedia was not able to
handle this so I created a new account at crystal tech, but I am geting
the same issues.
Apparently CF directory is very taxing on a
shared server, can anyone recommend a way to view these files in a combo
box not using CFdirectory?
Thanks in Advance
Mike