With your suggestion and a few tweaks it does what I want.
Thanks Mike!
Robert O.
-Original Message-
From: Dawson, Michael [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 4:34 PM
To: CF-Talk
Subject: RE: CFDIRECTORY question
Why not just use CFDIRECTORY on each page
Why not just use CFDIRECTORY on each page request? This will ensure
that you have the most up-to-date list of directories.
What is the point of adding these to the database which could quickly
become outdated?
If you still need to do this, I would query the database, then run
CFDIRECTORY.
One other option is to run CFDIRECTORY, clear the table and reload it
with the CFDIRECTORY results.
If you were to do this, I would use a named CFLOCK around the code to
ensure that no person hits an empty table while you are updating it.
M!ke
-Original Message-
From: Robert Orlini
There are a number of ways to do this, but the easiest and not sure if
it is the quickest way.
Is to loop through and do a query to see if that directory is listed in
the database if it isn't then do an insert into the database.
Regards,
Andrew Scott
-Original Message-
From: Robert
, but it will reduce
the number of data base interactions by two.
Six of one, 1/2-dozen of the other...
-Original Message-
From: Andrew Scott [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 7:49 PM
To: CF-Talk
Subject: RE: CFDIRECTORY question
There are a number of ways
keep your image references in a table in a database, so that when a
product
is entered, so is the path to/or a boolean field denoting an image
exists for this
product, and same when you edit/update/delete the product, you can also
make the call to the db to remove the image/image reference.
this
use cfdirectory to get a list of files in the directory, loop through it to
find the right one, or rather if it exists, if it doesn't, display your
default gif/jpg
A bit simplified maybe, but that's the gist(?) of it
Ade
-Original Message-
From: Larry Juncker [mailto:[EMAIL PROTECTED]]
FileExists():
cfif FileExists(images/#sku#.gif)
img src=images/#sku#.gif
cfelseif FileExists(images/#sku#.jpg)
img src=images/#sku#.gif
/cfif
Though I'd prefer Tonys method, so you don't have to do a lot of file checking. We
use it a lot on a app here and haven't run into any
Use the function FileExists(ExpandPath(images/ sku .gif))
-Original Message-
From: Larry Juncker [mailto:[EMAIL PROTECTED]]
Sent: maandag 9 september 2002 15:10
To: CF-Talk
Subject: CFDirectory Question
I have a shopping cart that I have created and the images can be either
gif or
I'd also recommend storing the file extension in the products table in your
db, however, if you need to get it from file system, the simplest way is
probably this:
cfdirectory action=list name=rsprodimg filter=#sku#.*
directory=#ExpandPath('images')#
cfif len(rsprodimg.name[1])img
cfdirectory action = list
directory = directory
name = queryName
filter = *.jpg should do it. // whatever u want to filer..
Joe
- Original Message -
From: Larry Juncker [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Monday, September 09, 2002 9:10 AM
Subject: CFDirectory
[EMAIL PROTECTED]
Sent: Monday, September 09, 2002 8:23 AM
Subject: Re: CFDirectory Question
FileExists():
cfif FileExists(images/#sku#.gif)
img src=images/#sku#.gif
cfelseif FileExists(images/#sku#.jpg)
img src=images/#sku#.gif
/cfif
Though I'd prefer Tonys method, so you don't
Jay,
There's a tag cfx_wait in the gallery that might help you. After the
deleting-images query, you might want to execute this tag to wait x seconds
before processing the next line.
Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com
- Original
Randy:
Thanks for the note. As usual, after sending my note to the list, when I
re-read the manual for the size parameter, "size of directory entry", I
realized I had misinterpreted the section.
-Gerry
"Adkins, Randy" wrote:
A Directory will have the filesize of ZERO.
It will not give you
A Directory will have the filesize of ZERO.
It will not give you the Total file size of all
files located in that Directory.
You will have to take each Directory then
ReQuery that Directory to get the total.
You make check the Dev Exchange to see if there
is a Tag already that does this for
You can trim the extension via #ListFirst(qDirectory.Name,".")#
(assuming there's only one period per file name).
What's wrong with a simple CFQUERYinsert/CFQUERY?
-David
On Tue, 5 Sep 2000 Jacob McKee [EMAIL PROTECTED] writes:
Please help!
I need to know how to read all the files in a
16 matches
Mail list logo