Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE upload not working

Status
Not open for further replies.

calista

Programmer
Jan 24, 2001
545
US
I'm probably just having a serious case of brain breeze, but here it is. This is my form page to upload two files(among other information):
Code:
<CFOUTPUT>
	<FORM ACTION=&quot;AddNewToolAction.cfm&quot; METHOD=&quot;post&quot;>
		<B>Enter Tool Name</B><BR>
		<INPUT TYPE=&quot;text&quot; NAME=&quot;ToolName&quot; SIZE=&quot;75&quot; MAXLENGTH=&quot;254&quot;><BR><BR>
		<B>Enter Description of Tool</B><BR>
		<INPUT TYPE=&quot;text&quot; NAME=&quot;ToolDescription&quot; SIZE=&quot;75&quot; MAXLENGTH=&quot;254&quot;><BR><BR>
		<B>Select executable file:</B><BR>
		<INPUT TYPE=&quot;File&quot; NAME=&quot;ExeFile&quot; SIZE=&quot;63&quot; MAXLENGTH=&quot;254&quot;><BR><BR>
		<B>Select document file:</B><BR>
		<INPUT TYPE=&quot;File&quot; NAME=&quot;DocFile&quot; SIZE=&quot;63&quot; MAXLENGTH=&quot;254&quot;><BR><BR>
		<INPUT TYPE=&quot;submit&quot; NAME=&quot;Submit&quot; VALUE=&quot;Submit&quot;>     
		<INPUT TYPE=&quot;reset&quot; NAME=&quot;Reset&quot; VALUE=&quot;Clear Form&quot;><BR><BR>
	</FORM>
	</CFOUTPUT>
And here is my action page:
Code:
<!--- Define variables --->
<CFSET MyDirectory = &quot;C:\Inetpub\[URL unfurl="true"]wwwroot\CFDOCS\NewIntranet\Documents&quot;>[/URL]
<CFSET ToolName = &quot;#Form.ToolName#&quot;>
<CFSET ToolDescription = &quot;#Form.ToolDescription#&quot;>

<!--- First, upload the executable file. --->
<CFFILE ACTION=&quot;UPLOAD&quot;
        FILEFIELD=&quot;ExeFile&quot;
        DESTINATION=&quot;#MyDirectory#&quot;
        NAMECONFLICT=&quot;Error&quot;>
<CFSET ToolLocation = &quot;#File.ServerDirectory#\#File.ServerFile#&quot;>

<!--- Then upload documentation --->
<CFFILE ACTION=&quot;UPLOAD&quot;
        FILEFIELD=&quot;DocFile&quot;
        DESTINATION=&quot;#MyDirectory#&quot;
        NAMECONFLICT=&quot;Error&quot;>
<CFSET ToolDocLocation = &quot;#File.ServerDirectory#\#File.ServerFile#&quot;>

<!--- Insert data --->
<CFQUERY NAME=&quot;InsertData&quot;
   	DATASOURCE=&quot;#Application.Datasource#&quot;
     	DBTYPE=&quot;ODBC&quot;>
	INSERT INTO ToolTable
	(ToolID,ToolName,ToolDescription,ToolLocation,ToolDocLocation)
	VALUES
	('#CreateUUID()#','#ToolName#','#ToolDescription#','#ToolLocation#','#ToolDocLocation#')
</CFQUERY>
And this is the error I get. I checked my form fields, and EXEFILE does exist and contains data.

Error in CFFILE tag

The form field specified in the CFFILE tag (EXEFILE) does not contain an uploaded file. Please be sure that you have specified the correct form field name.

The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (16:1) to (19:29) in the template file C:\Inetpub\
I copied the logic from another form that works fine. What am I doing wrong, here? Thanks for your help!
Calista :-X
Jedi Knight,
Champion of the Force
 
I still have the same problem on my CF 4.5.1 server installation. After the update form 4.0 to 4.5 the problem
occured.

on the forums from Allaire there are many solutions for this problem :


You have to search for : file upload

Some solutions work incombination with some browser and servers others don't. Later this week I'm going to install SP2 for CF. thats the only thing I haven't tried yet.

succes

Jurriaan Balleur
 
I still have the same problem on my CF 4.5.1 server installation. After the update form 4.0 to 4.5 the problem
occured.

on the forums from Allaire there are many solutions for this problem :


You have to search for : file upload on all forums

Some solutions work incombination with some browser and servers others don't. Later this week I'm going to install SP2 for CF. thats the only thing I haven't tried yet.

succes

Jurriaan Balleur
 
Thanks for the info. I will check it out. However, I have CF 4.5.2, and I have been using the same version all along. Calista :-X
Jedi Knight,
Champion of the Force
 
You may find something about authentication in IIS
maybe your solution is something like that

Jurriaan
 
Doh! I knew it was a case of brain freeze! I forgot

ENCTYPE=&quot;multipart/form-data&quot;>

in my FORM tag. Works fine, now! Calista :-X
Jedi Knight,
Champion of the Force
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top