Use CFDIRECTORY and get a list of the filenames in a specific folder.
Then query the database for all files, and compare the two.
If the filename is not in the database, delete it.
 
Russ
> -----Original Message-----
> From: Jenny [mailto:[EMAIL PROTECTED] 
> Sent: 23 August 2004 19:59
> To: [EMAIL PROTECTED]
> Subject: Re: [ cf-dev ] CFFILE ....
> 
> Thanks Russ and everyone else who helped on this.
> 
> Looks like I'll follow the vote and store files outside the 
> database.  It does bug me on a point of principal that I've 
> never got to the bottom of making the database file store work though.
> 
> Next silly question, would it be possible to compare the pic 
> directory contents to the filenames in the db, and delete any 
> not in the db?  A tidy up excercise basically.
> 
> Thankies, Jenny
> 
> ----- Original Message -----
> From: "Russ Michaels (Snake)" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, August 23, 2004 12:08 PM
> Subject: RE: [ cf-dev ] CFFILE ....
> 
> 
> > Also if you store all the images in the database, you will need a
> seriously
> > hefty database server to manage it if you have a lot of 
> images. And it
> will
> > be much slower than just storing the filenames in the database.
> > There is generally no good reason to store the images in 
> the database for
> a
> > web site.
> >
> > Upload file to server
> > Store filename in database
> >
> > To display images
> > Read filenames from database, us them in the IMG tag.
> > E.g
> > <img src="/images/#filename#">
> >
> > If someone deletes their image, read the filename from the 
> database and
> > delete it from the server.
> >
> > Very simple and clean.
> >
> > If you store your images in the database, you will need a 
> huge database,
> you
> > will not be able to link to images or view them online, all 
> data must be
> > read and delivered to the browser using cfcontent for example.
> > If this is a dating site, users may want to link to their images.
> >
> >
> > Russ
> >
> >
> > > -----Original Message-----
> > > From: Jenny [mailto:[EMAIL PROTECTED]
> > > Sent: 22 August 2004 06:56
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [ cf-dev ] CFFILE ....
> > >
> > > hi Ade,
> > >
> > > Yes, that's the bit I'm stuck on.  How to display the image
> > > now I've stored it as text.
> > >
> > > And yep, it's a dating site.  Shameless plug:
> > > http://www.chicksNchaps.co.uk
> > >
> > > Thanks for your help,
> > >
> > > Jenny
> > > ----- Original Message -----
> > > From: "Adrian Lynch" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Saturday, August 21, 2004 11:08 PM
> > > Subject: RE: [ cf-dev ] CFFILE ....
> > >
> > >
> > > > I think you might be making problems for yourself further
> > > down the line.
> > > But
> > > > first thing I noticed is you have...
> > > >
> > > > <img src="#binarydata#">
> > > >
> > > > ... if src isn't a path to a file it won't work. cfcontent
> > > might be what
> > > you
> > > > want but I'd still suggest storing them in the file system
> > > and store data
> > > > about the images in the DB. I'm sure that's the general
> > > consensus on the
> > > > list too.
> > > >
> > > > BTW, is this a dating site you're doing,
> > > dating\profiles\photos, just call
> > > > me Miss Marple :OD
> > > >
> > > > Ade
> > > >
> > > > -----Original Message-----
> > > > From: Jenny [mailto:[EMAIL PROTECTED]
> > > > Sent: 21 August 2004 22:44
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: [ cf-dev ] CFFILE ....
> > > >
> > > >
> > > > yep, replying to self has to be as bad as talking to self
> > > .. cracking up
> > > ...
> > > >
> > > > got this far .. seems like the data has to go into an ntext
> > > type .. binary
> > > > said truncated, and varbinary said wrong data type .. so as
> > > it's a string
> > > > ... ?
> > > >
> > > > At the end is my feeble attempt to get the data out again ...
> > > >
> > > > arrrrrgggghhhhhh
> > > >
> > > >
> > > > <cffile action = "readBinary" file =
> > > > "\apache\apache2\dating\profiles\photos\thumbs\#thumbname#"
> > > variable =
> > > > "thumb1">
> > > > <cffile action = "readBinary" file =
> > > >
> > > "\apache\apache2\dating\profiles\photos\thumbs\small\#thumbnam
> > > e#" variable
> > > =
> > > > "thumb2">
> > > > <!-- convert to base 64 -->
> > > > <cfoutput>
> > > > <cfset thumb1_64=tobase64(thumb1)>
> > > > <cfset thumb2_64=tobase64(thumb2)>
> > > > </cfoutput>
> > > > <cfoutput>
> > > >   <cfquery datasource="dating">
> > > >  UPDATE Registered
> > > >  SET PhotoThumbB = '#thumb1_64#', PhotoThumbSmallB = 
> '#thumb2_64#'
> > > > WHERE Registered.RegisterID = #session.registerID#
> > > >   </cfquery>
> > > >   </cfoutput>
> > > > <cfquery name="Register2" datasource="dating">
> > > > SELECT *
> > > > FROM dbo.Registered
> > > > WHERE dbo.Registered.RegisterID = #session.registerID#
> > > > </cfquery>
> > > >
> > > > <cfoutput>
> > > > <cfset binaryData = toBinary(#register2.photothumbsmallB#)>
> > > >  <img src="#binarydata#">
> > > > </cfoutput>
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Jenny" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Saturday, August 21, 2004 9:45 PM
> > > > Subject: Re: [ cf-dev ] CFFILE ....
> > > >
> > > >
> > > > > Hi Adrian,
> > > > >
> > > > > Thanks, but just too many files to manage in this way.
> > > > >
> > > > > I've been playing around with base 64 and am struggling.
> > > I get a photo
> > > > > uploaed, create thumbs, then need to store the thumbs.
> > > Hope the below
> > > > makes
> > > > > some sense and someone can tell me what silly thing I 
> am doing.
> > > > >
> > > > >
> > > > > <cfoutput>
> > > > > <cfexecute name = "c:\Program
> > > Files\ImageMagick-6.0.1-Q16\convert.exe"
> > > > > arguments = "-sample 200x200
> > > > > c:\apache\apache2\dating\profiles\photos\#search_word[1]#
> > > > >
> > > c:\apache\apache2\dating\profiles\photos\thumbs\#thumbname#"><
> > > /cfexecute>
> > > > > <cfexecute name = "c:\Program
> > > Files\ImageMagick-6.0.1-Q16\convert.exe"
> > > > > arguments = "-sample 125x125
> > > > > c:\apache\apache2\dating\profiles\photos\#search_word[1]#
> > > > >
> > > >
> > > c:\apache\apache2\dating\profiles\photos\thumbs\small\#thumbna
> > > me#"></cfexecu
> > > > > te>
> > > > > </cfoutput>
> > > > >
> > > > > <cffile action = "readBinary" file =
> > > > >
> > > "c:\apache\apache2\dating\profiles\photos\thumbs\#thumbname#"
> > > variable =
> > > > > "thumb1">
> > > > > <cffile action = "readBinary" file =
> > > > >
> > > 
> "c:\apache\apache2\dating\profiles\photos\thumbs\small\#thumbname#"
> > > > variable
> > > > > = "thumb2"><cfabort>
> > > > > <!-- convert to base 64 -->
> > > > > <cfoutput>
> > > > > <cfset thumb1_64=tobase64(thumb1)>
> > > > > <cfset thumb2_64=tobase64(thumb2)>
> > > > > </cfoutput>
> > > > > <cfoutput>
> > > > >   <cfquery datasource="dating">
> > > > >  UPDATE Registered
> > > > >  SET PhotoThumb = '#thumb1#', PhotoThumbSmall = '#thumb2#'
> > > > > WHERE Registered.RegisterID = #session.registerID#
> > > > >   </cfquery>
> > > > >   </cfoutput>
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Adrian Lynch" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Saturday, August 21, 2004 6:28 PM
> > > > > Subject: RE: [ cf-dev ] CFFILE ....
> > > > >
> > > > >
> > > > > > Don't store them directly in the DB, instead use
> > > cfdirectory to get
> > > them
> > > > > all
> > > > > > and put their names in a table.
> > > > > >
> > > > > > <cfdirectory action="list" directory="#pathToImages#"
> > > name="qDir">
> > > > > >
> > > > > > <cfloop query="qDir">
> > > > > >
> > > > > > <cfquery>
> > > > > > INSERT INTO .....
> > > > > > </cfquery>
> > > > > >
> > > > > > </loop>
> > > > > >
> > > > > > About as quick and easy as it gets I think...
> > > > > >
> > > > > > Ade
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jenny [mailto:[EMAIL PROTECTED]
> > > > > > Sent: 21 August 2004 16:57
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: Re: [ cf-dev ] CFFILE ....
> > > > > >
> > > > > >
> > > > > > Ok, this is getting messy storing pics as files .. is
> > > there an easy
> > > way
> > > > to
> > > > > > store them in an ms sql 7 database please?
> > > > > >
> > > > > > Thanks, Jenny
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Jenny" <[EMAIL PROTECTED]>
> > > > > > To: <[EMAIL PROTECTED]>
> > > > > > Sent: Saturday, August 21, 2004 4:33 PM
> > > > > > Subject: Re: [ cf-dev ] CFFILE ....
> > > > > >
> > > > > >
> > > > > > > Thanks Terry, I'd missed the fileexists function.
> > > > > > >
> > > > > > > Jenny
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Terry Riley" <[EMAIL PROTECTED]>
> > > > > > > To: <[EMAIL PROTECTED]>
> > > > > > > Sent: Saturday, August 21, 2004 12:24 PM
> > > > > > > Subject: Re: [ cf-dev ] CFFILE ....
> > > > > > >
> > > > > > >
> > > > > > > > Sure.
> > > > > > > >
> > > > > > > > Something like this:
> > > > > > > >
> > > > > > > > <cfif FileExists(#variables.x_file_name#)>
> > > > > > > > <cffile action="DELETE" file="#variables.x_file_name#">
> > > > > > > > </cfif>
> > > > > > > >
> > > > > > > > Of course, you'll have to substitute your own file
> > > name for the
> > > > > > variable.
> > > > > > > >
> > > > > > > > Cheers
> > > > > > > > Terry
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > >
> > > > > > > > > Hi all,
> > > > > > > > >
> > > > > > > > > Is there a way to check for the existence of a
> > > file before doing
> > > a
> > > > > > > > > cffile
> > > > > > > > > delete, please?
> > > > > > > > >
> > > > > > > > > Thanks, Jen
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > (have to get in plug for new web site ..
> > > > > > http://www.chicksNchaps.co.uk)
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > These lists are syncronised with the 
> CFDeveloper forum at
> > > > > > > http://forum.cfdeveloper.co.uk/
> > > > > > > > Archive:
> > > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > > > > > >
> > > > > > > > CFDeveloper Sponsors and contributors:-
> > > > > > > > *Hosting and support provided by CFMXhosting.co.uk*
> > > :: *ActivePDF
> > > > > > provided
> > > > > > > by activepdf.com*
> > > > > > > >       *Forums provided by fusetalk.com* ::
> > > *ProWorkFlow provided
> > > by
> > > > > > > proworkflow.com*
> > > > > > > >            *Tutorials provided by helmguru.com* ::
> > > *Lists hosted
> > > by
> > > > > > > gradwell.com*
> > > > > > > >
> > > > > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ---
> > > > > > > Outgoing mail is certified Virus Free.
> > > > > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > > > > Version: 6.0.742 / Virus Database: 495 - Release
> > > Date: 19/08/2004
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > These lists are syncronised with the CFDeveloper forum at
> > > > > > http://forum.cfdeveloper.co.uk/
> > > > > > > Archive:
> > > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > > > > >
> > > > > > > CFDeveloper Sponsors and contributors:-
> > > > > > > *Hosting and support provided by CFMXhosting.co.uk*
> > > :: *ActivePDF
> > > > > provided
> > > > > > by activepdf.com*
> > > > > > >       *Forums provided by fusetalk.com* ::
> > > *ProWorkFlow provided by
> > > > > > proworkflow.com*
> > > > > > >            *Tutorials provided by helmguru.com* ::
> > > *Lists hosted by
> > > > > > gradwell.com*
> > > > > > >
> > > > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > ---
> > > > > > Outgoing mail is certified Virus Free.
> > > > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > > > Version: 6.0.742 / Virus Database: 495 - Release Date:
> > > 19/08/2004
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > These lists are syncronised with the CFDeveloper forum at
> > > > > > http://forum.cfdeveloper.co.uk/
> > > > > > Archive:
> > > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > > > >
> > > > > > CFDeveloper Sponsors and contributors:-
> > > > > > *Hosting and support provided by CFMXhosting.co.uk* ::
> > > *ActivePDF
> > > > provided
> > > > > > by activepdf.com*
> > > > > >       *Forums provided by fusetalk.com* :: *ProWorkFlow
> > > provided by
> > > > > > proworkflow.com*
> > > > > >            *Tutorials provided by helmguru.com* ::
> > > *Lists hosted by
> > > > > > gradwell.com*
> > > > > >
> > > > > > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > > > --
> > > > > > These lists are syncronised with the CFDeveloper forum at
> > > > > http://forum.cfdeveloper.co.uk/
> > > > > > Archive:
> > > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > > > >
> > > > > > CFDeveloper Sponsors and contributors:-
> > > > > > *Hosting and support provided by CFMXhosting.co.uk* ::
> > > *ActivePDF
> > > > provided
> > > > > by activepdf.com*
> > > > > >       *Forums provided by fusetalk.com* :: *ProWorkFlow
> > > provided by
> > > > > proworkflow.com*
> > > > > >            *Tutorials provided by helmguru.com* ::
> > > *Lists hosted by
> > > > > gradwell.com*
> > > > > >
> > > > > > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > ---
> > > > > Outgoing mail is certified Virus Free.
> > > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > > Version: 6.0.742 / Virus Database: 495 - Release 
> Date: 19/08/2004
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > These lists are syncronised with the CFDeveloper forum at
> > > > http://forum.cfdeveloper.co.uk/
> > > > > Archive:
> > > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > > >
> > > > > CFDeveloper Sponsors and contributors:-
> > > > > *Hosting and support provided by CFMXhosting.co.uk* 
> :: *ActivePDF
> > > provided
> > > > by activepdf.com*
> > > > >       *Forums provided by fusetalk.com* :: *ProWorkFlow
> > > provided by
> > > > proworkflow.com*
> > > > >            *Tutorials provided by helmguru.com* :: *Lists
> > > hosted by
> > > > gradwell.com*
> > > > >
> > > > > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > > ---
> > > > Outgoing mail is certified Virus Free.
> > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > Version: 6.0.742 / Virus Database: 495 - Release Date: 
> 19/08/2004
> > > >
> > > >
> > > >
> > > > --
> > > > These lists are syncronised with the CFDeveloper forum at
> > > > http://forum.cfdeveloper.co.uk/
> > > > Archive: 
> http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > >
> > > > CFDeveloper Sponsors and contributors:-
> > > > *Hosting and support provided by CFMXhosting.co.uk* ::
> > > *ActivePDF provided
> > > > by activepdf.com*
> > > >       *Forums provided by fusetalk.com* :: *ProWorkFlow 
> provided by
> > > > proworkflow.com*
> > > >            *Tutorials provided by helmguru.com* :: 
> *Lists hosted by
> > > > gradwell.com*
> > > >
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > > -- 
> > > > These lists are syncronised with the CFDeveloper forum at
> > > http://forum.cfdeveloper.co.uk/
> > > > Archive: 
> http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > >
> > > > CFDeveloper Sponsors and contributors:-
> > > > *Hosting and support provided by CFMXhosting.co.uk* ::
> > > *ActivePDF provided
> > > by activepdf.com*
> > > >       *Forums provided by fusetalk.com* :: *ProWorkFlow 
> provided by
> > > proworkflow.com*
> > > >            *Tutorials provided by helmguru.com* :: 
> *Lists hosted by
> > > gradwell.com*
> > > >
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.742 / Virus Database: 495 - Release Date: 20/08/2004
> > >
> > >
> > >
> > > -- 
> > > These lists are syncronised with the CFDeveloper forum at
> > > http://forum.cfdeveloper.co.uk/
> > > Archive: 
> http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > >
> > > CFDeveloper Sponsors and contributors:-
> > > *Hosting and support provided by CFMXhosting.co.uk* ::
> > > *ActivePDF provided by activepdf.com*
> > >       *Forums provided by fusetalk.com* :: *ProWorkFlow
> > > provided by proworkflow.com*
> > >            *Tutorials provided by helmguru.com* :: *Lists
> > > hosted by gradwell.com*
> > >
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> > -- 
> > These lists are syncronised with the CFDeveloper forum at
> http://forum.cfdeveloper.co.uk/
> > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> >
> > CFDeveloper Sponsors and contributors:-
> > *Hosting and support provided by CFMXhosting.co.uk* :: 
> *ActivePDF provided
> by activepdf.com*
> >       *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
> proworkflow.com*
> >            *Tutorials provided by helmguru.com* :: *Lists hosted by
> gradwell.com*
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.742 / Virus Database: 495 - Release Date: 20/08/2004
> 
> 
> 
> -- 
> These lists are syncronised with the CFDeveloper forum at 
> http://forum.cfdeveloper.co.uk/
> Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>  
> CFDeveloper Sponsors and contributors:-
> *Hosting and support provided by CFMXhosting.co.uk* :: 
> *ActivePDF provided by activepdf.com*
>       *Forums provided by fusetalk.com* :: *ProWorkFlow 
> provided by proworkflow.com*
>            *Tutorials provided by helmguru.com* :: *Lists 
> hosted by gradwell.com*
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> 
> 



-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to