![]() |
| Get CFDIR... file list & insert to table |
|
palyne
|
Hi, I'm sorry to ask such a simple question but apparently sleep deprivation has finally gotten to me, and websearches don't turn up the answer to this.
I have a bunch of files (~10,000) that are royalty-free with-permission images. I finally got them all onto my server's hard drive. Now, I need to basically use cfdirectory to go through the list of the files and insert each filename into a table. Cfloop does this easily of course. But that's a lot to loop. Now if this was in another table I could do a subquery like [maxrows=100](insert into table1 filename where (select filename from table2 where recordid > [variable with counter like 100, 200, etc.])) I do see that cfdirectory "makes the filename list available as a query object", conveniently. But I don't understand how to use the cfdirectory IN the subquery, mostly because even if I said (select filename from {cfdirectory}NAME), I don't know how to spec a LIMIT, with the subquery being the tag, such as the "where record > {number}". And my server already seems to reboot nearly every half hour (if that) as a given, so I have no wish to pull 10,000 records into a query-with-subquery-with-write function and probably take it down again. Does anybody have ideas? A code example (if you do) would be awesome. Thanks so much. Palyne |
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
Check out this article on how to return directory info using java instead of cfdirectory... it may be a better route for you to take given the size of your dataset:
http://www.coldfusionmuse.com/index.cfm/2006/10/26/Java.directory.list |
||||||||||||
|
|
|||||||||||||
|
palyne
|
Thanks Bob. You knew that off the top of your head?? I'm impressed.
I could stick this script in a page, as it refs:
But I don't know what to DO with whatever it gets me. I've never called data from anything but cfquery before. I don't know how the {whatever-it ends-up-with that holds the data} is to be called and placed into the sql table. I'll paypal you handholding tips if you like, but can you give me a clue, if I use the script above (replacing the directory structure), assuming it works for me, what then? [/code] |
||||||||||||||
|
|
|||||||||||||||
|
Jason101
Forum Regular
|
Someone had requested this last week, and I posted my code.
This Post: http://forums.hostmysite.com/viewtopic.php?t=3871づ Will show you how to go through the array that is returned |
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
Cool- I totally forgot about that thread....
On another note- remember you can use <cftrace> and <cfdump> to examine variables to see what's in them- especially handy for variables that contain structures or other complex data types. |
||||||||||||
|
|
|||||||||||||
|
Jason101
Forum Regular
|
Absolutely. CFDump is your best friend |
||||||||||||||
|
|
|||||||||||||||
|
jamie
HostMySite Sales Rep
![]()
|
Until they make CFBlink, sure. |
||||||||||||||||
|
|
|||||||||||||||||
| CFBlink? |
|
comprug
Forum Regular
|
CFBlink? What? Somehow I'm not getting something here...
|
||||||||||||
|
|
|||||||||||||
| Re: CFBlink? |
|
jamie
HostMySite Sales Rep
![]()
|
I've been ranting for years that the <BLINK> tag was the worst tag EVER made...so a CFBLINK tag would be the worst CF tag ever. |
||||||||||||||
|
|
|||||||||||||||
| Get CFDIR... file list & insert to table |
|
||
|



