Gary,
 
I'm probably the low man on the totem pole are far as coding in this group but the following code works for me.
 
<!--- The Form --->
<form action="" method="post" enctype="multipart/form-data">
<input type="file" size="35" name="txtFileName">
<br>
<input type='submit' value="Submit">
</cfform>
 
<!--- UploadForm.cfm --->
<cfif #Trim(form.txtFileName)# IS NOT "">
 <cffile action=""
   filefield="txtFileName"
   destination="c:\wwwroot\domainname.com\OnlineForms\"
   nameconflict="OVERWRITE">
 
 <!--- I've had problems with spaces in file names, so I replace them here with a underscore --->
 <cfset NewFileName = "#Replace(file.clientfile, " ", "_", "ALL")#">
 
 <cffile action=""
   source="c:\wwwroot\domainname.com\OnlineForms\#file.clientfile#"
   destination="c:\wwwroot\domainname.com\OnlineForms\#NewFileName#">
</cfif>
 
Thanks,
Terry


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alford, Gary L
Sent: Monday, February 21, 2005 8:32 AM
To: DFW ColdFusion Users Group (E-mail)
Subject: [SPAM-Connection] File Upload...

I am trying to develop some code that is capable of uploading video files to a specific subdirectory location on the server (please note that I have never tried this before - a first time for everything).  I have tried a standard HTML form with <input type=file... and I have tried a CFML form with <CFFILE>.  I can't get either one to work.
 
Has anyone out there done this (I'm sure there is) and what is the best / easiest way to accomplish this?
 
Any information would be greatly appreciated.


Gary L. Alford
Manufacturing Operations Project Specialist
Bell Helicopter XWorx
Phone: (817) 280-6233     Fax: (817) 278-6233
[EMAIL PROTECTED]

I have not failed.  I've found 10,000 ways that won't work.
          Thomas A. Edison

 

<<Glacier Bkgrd.jpg>>

Reply via email to