You can do the upload to a directory and then
use the #Client.Filename# vairable to run
the query in the DB to check if it exists.

If exists
   ASK FOR OVERWRITE
        IF NO then delete file
        Else
                Add to DB
Else
   ADD TO DB

Hope this helps.


-----Original Message-----
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 01, 2000 2:19 PM
To: CF-Talk
Subject: Uploading a file with CFFILE


I have a form that asks for the file with a  <input name="FileName" size=30 
type="FILE">

I would like to be able to compare the file name to a database value in my 
action page before using <CFFILE> to upload it.  This way if the file is 
being overwritten i give the user one last chance to do this.


<cfif #Query.FileName# IS NOT #FORM.filename#>

Are you sure you want to overwrite this file?
Yes/No

<cfelse>
Write the file and update the database
</cfif>

The only problem is when you use <input name="FileName" size=30 
type="FILE"> the file name being passed is not the actual name of the 
file.  It is something like FILENAME=C:\WINNT\ACF12E.tmp.

So my CFIF statement always says that the file names dont match....

Is there any way to get my <input name="FileName" size=30 type="FILE"> to 
pass the real name of the file????
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to