almost correct....replace "File." with "CFFILE." ;-)

Now why would you "check to see if the file is present before I do the CFFILE statement"??

If you're uploading there is no reason to check your server for the file...it hasn't been uploaded and therefore does not exist ;-)

There is nothing special to do with the form data (other than having the correct enctype which you do).  Post the form to whatever file you want.  In the file call CFFILE and make sure that you pass it the name of the form field that holds the location of the file on the client's computer AND an absolute path (i.e. c:\myimagedir\) on the server to the directory to save the file to.  You can also use the nameconflict attribute of the CFFILE tag to ensure that the file will get renamed if another file already exists with the same name.

      <cffile
        action=""
        filefield="txtMsgFile"
        destination="c:\myimagedir\
        nameconflict="MAKEUNIQUE">

HTH

Cheers

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com
  ----- Original Message -----
  From: Jamie Jackson
  To: CF-Talk
  Sent: Wednesday, January 28, 2004 11:32 AM
  Subject: Re: CFFILE and Form data

  Sorry that I don't have time to go into detail, but did you know about
  the following variables? They are specific to <CFFILE>, and I suspect
  your answer lies within...

  File.AttemptedServerFile
  File.ClientDirectory
  File.ClientFile
  File.ClientFileExt
  File.ClientFileName
  File.ContentSubType
  File.ContentType
  File.DateLastAccessed
  File.FileExisted
  File.FileSize
  File.FileWasAppended
  File.FileWasOverwritten
  File.FileWasRenamed
  File.FileWasSaved
  File.OldFileSize
  File.ServerDirectory
  File.ServerFile
  File.ServerFileExt
  File.ServerFileName
  File.TimeCreated
  File.TimeLastModified

  On Wed, 28 Jan 2004 14:20:36 -0400, in cf-talk you wrote:

  >I am somewhat new to CF and I am trying to use the CFFILE tag to upload a file to my server.  I figured out that in order to do so I had to include the correct enctype in the form tag (enctype="multipart/form-data).  Now the file extension is not being passed (i.e. "myfile.txt" becomes just "myfile") and so I am having difficulty trying to do verification on the destination file,  because I do not know the complete filename.  i.e.. <cfif FileExists("destpath")>
  >
  >Basically I need to find out how to pass the form data so that I can see the full filename including the extension so that I can check to see if the file is present before I do the CFFILE statement.  Any help would be appreciated.
  >-Chuck.
  >
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to