Oh okay, I see - the image is referred to by lanesid (img src=images/400/#lanesid#.jpg)
On Wed, 17 Nov 2004 22:56:16 +0100, Pascal Peters <[EMAIL PROTECTED]> wrote: > The general idea of what you are doing seems OK. Get the images from > your tables and compare them with the images in your file system. I was > asking what you are storing in your table. The image file name, the file > name without extension, the relative path to te file, the url to the > file, ...?? > > It is deleting all your images because > NOT listFind(fileNames, qDirectory.name) > always returns true. You have to find out why this happens. My best > guess is that your table doesn't store the filename, but something else > (the relative path from some directory maybe?). Or maybe you are on a > windows server and the stored filename doesn't respect the case (use > listFindNoCase then). > > There could be about a hundred more things that go wrong. You could > write a test page first that doesn't do the deletes, but outputs some > variables. > > > > Pascal > > > -----Original Message----- > > From: Donna French [mailto:[EMAIL PROTECTED] > > Sent: 17 November 2004 22:41 > > To: CF-Talk > > Subject: Re: Help! Error on ValueList SOLVED > > > > <cfset fileNames = valueList(qGetFilesnames.#imageColumnName#) /> > > > > I didn't write this code - you could probably figure that out by now. > > But what I'm trying to do is cleanup images off the server. When I > > first wrote this web app about 3 years ago, I didn't include logic to > > delete the image files when a product was deleted from the database. > > > > And I'm also in the process of re-designing the database, because I > > have products in two different tables (dolls and products). So don't > > slap my hand on that one. I had just started doing CF much less > > database work. > > > > I do appreciate all of the help and do not take anyone's time for > granted. > > > > ~ Donna > > > > > > On Wed, 17 Nov 2004 22:27:49 +0100, Pascal Peters <[EMAIL PROTECTED]> > wrote: > > > Your logic is probably wrong. What does #fileNames# contain??? Just > an > > > image name, a relative path, ...? Also, it's not a very good idea to > > > test your code on a live server. > > > > > > > > > > > > Pascal > > > > > > > -----Original Message----- > > > > From: Donna French [mailto:[EMAIL PROTECTED] > > > > Sent: 17 November 2004 22:14 > > > > To: CF-Talk > > > > Subject: Re: Help! Error on ValueList SOLVED > > > > > > > > Okay, that deleted all files in each directory so I'm having the > > > > hosting company restore from backup. > > > > > > > > Any ideas? > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184678 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

