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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uploading files

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
HELLO,

I have an html form contains ListBox named (list2) and this list box items contains FILES PATHs and can be selected multipe To upload these files as follow:

<!--- FILE NAME : file.cfm --->
<FORM ACTION=&quot;fileaction.cfm&quot; METHOD=&quot;Post&quot;>
<SELECT multiple name=&quot;list2&quot;>
</SELECT>
<input type=&quot;submit&quot;>
</FORM>

The action File is for get each file from each listbox items and then upload as in the following file:

<!--- FILE NAME : fileaction.cfm --->

<CFSET numberIngroup=10>
<CFSET employee_list=ArrayNew(1)>
<CFSET numberIngroup = #numberIngroup# + 1>

<CFLOOP from=&quot;1&quot; to=&quot;#numberIngroup#&quot; step=&quot;1&quot; index=&quot;i&quot;>

<CFSET employee_list=#GetToken(FORM.list2, i, &quot;,&quot;)#>
<CFIF employee_list neq &quot;&quot;>
<CFSET file.clientfile = ''>
<CFIF trim(employee_list) NEQ ''>

<CFFILE action=&quot;UPLOAD&quot; filefield=&quot;employee_list&quot;
destination=&quot;#expandpath('./docs/')#&quot; nameconflict=&quot;MAKEUNIQUE&quot;>

</CFIF>
<CFELSE>
<CFBREAK>
</CFIF>
</CFLOOP>

The promlem occured may be because the array (employee_list) items not a form field to put in filefield parameter in CFFILE tag.

Is There a solution for this problem..

Please Reply to me

Thanks
 
try using enctype=&quot;multipart/form-data&quot; in your form tag, i seem to rember needing it last time i did a file upload form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top