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!

Multiple file upload

Status
Not open for further replies.

izachar

Technical User
Oct 7, 2000
84
CA
I am trying to upload 4 files to 4 separate locations in one transaction. I can do it with one file but it does not want to work with multiple.Here is what I am doing

This is the form:
...
<td width=&quot;112&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>
<p>Property Picture:
<input name=&quot;picture&quot; type=&quot;file&quot;>
</p>
</td>
<td width=&quot;203&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>Directions: <br>
<input name=&quot;directions&quot; type=&quot;file&quot;>
</td>
<td width=&quot;205&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>Layout: <br>
<input name=&quot;layout&quot; type=&quot;file&quot;>
</td>
<td bordercolor=&quot;black&quot; colspan=&quot;2&quot; valign=&quot;top&quot;>Arial:<br>
<input name=&quot;arial&quot; type=&quot;file&quot;>
</td>
</tr>
</table>
<br><br>
</cfoutput>
<input type=&quot;submit&quot; value=&quot;Upload File&quot;>
<input type=&quot;reset&quot; value=&quot;Clear&quot;>



This is the upload file:
...
<cfoutput>
<cfif picture neq &quot;&quot;>
<CFFILE
ACTION=&quot;Upload&quot;
FILEFIELD=&quot;picture&quot;
DESTINATION=&quot;e:\inetpub\ NAMECONFLICT=&quot;MAKEUNIQUE&quot;>

<cffile
action=&quot;rename&quot;
source=&quot;e:\inetpub\ destination=&quot;e:\inetpub\</cfif>
</cfoutput>
<cfoutput>
<cfif directions neq &quot;&quot;>
<CFFILE
ACTION=&quot;Upload&quot;
FILEFIELD=&quot;directions&quot;
DESTINATION=&quot;e:\inetpub\ NAMECONFLICT=&quot;MAKEUNIQUE&quot;>

<cffile
action=&quot;rename&quot;
source=&quot;e:\inetpub\ destination=&quot;e:\inetpub\</cfif>
</cfoutput>
<cfoutput>
<cfif layout neq &quot;&quot;>
<CFFILE
ACTION=&quot;Upload&quot;
FILEFIELD=&quot;layout&quot;
DESTINATION=&quot;e:\inetpub\ NAMECONFLICT=&quot;MAKEUNIQUE&quot;>

<cffile
action=&quot;rename&quot;
source=&quot;e:\inetpub\ destination=&quot;e:\inetpub\</cfif>
</cfoutput>
<cfoutput>
<cfif arial neq &quot;&quot;>
<CFFILE
ACTION=&quot;Upload&quot;
FILEFIELD=&quot;arial&quot;
DESTINATION=&quot;e:\inetpub\ NAMECONFLICT=&quot;MAKEUNIQUE&quot;>

<cffile
action=&quot;rename&quot;
source=&quot;e:\inetpub\ destination=&quot;e:\inetpub\</cfif>
</cfoutput>....
 
Do you get an error, or it just doesn't work? - tleish
 
I get:

Error in CFFILE tag

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

 
You must set the ENCTYPE in your form tag.

In most cases you will not need to use this attribute at all. The default value (i.e. if you don't use this attribute at all) is &quot;application/x- which is sufficient for almost any kind of form data. The one exception is if you want to do file uploads. In that case you should use &quot;multipart/form-data&quot;.

<FORM NAME=&quot;myForm&quot; METHOD=&quot;post&quot; ACTION=&quot;mypage.cfm&quot; ENCTYPE=&quot;multipart/form-data&quot;>
<table>
<tr>
<td width=&quot;112&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>
<p>Property Picture:
<input type=&quot;file&quot; name=&quot;picture&quot; >
</p>
</td>
<td width=&quot;203&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>Directions: <br>
<input name=&quot;directions&quot; type=&quot;file&quot;>
</td>
<td width=&quot;205&quot; bordercolor=&quot;black&quot; valign=&quot;top&quot;>Layout: <br>
<input name=&quot;layout&quot; type=&quot;file&quot;>
</td>
<td bordercolor=&quot;black&quot; colspan=&quot;2&quot; valign=&quot;top&quot;>Arial:<br>
<input name=&quot;arial&quot; type=&quot;file&quot;>
</td>
</tr>
</table>
<br><br>
<input type=&quot;submit&quot; value=&quot;Upload File&quot;>
<input type=&quot;reset&quot; value=&quot;Clear&quot;>
</FORM> - tleish
 
thank you tleish it worked great.
CFHub i used <cfif (form.name) neq &quot;&quot;> for the empty upload files

thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top