|
ColdFusion 9.0 Resources |
cffile action = "uploadAll"Syntax<cffile
action = "uploadAll"
destination = "full pathname"
accept = "list of MIME types"
attributes = "file attribute or list"
mode = "permission"
nameConflict = "behavior"
result = "result name">
Note: You
can specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
Attributes
UsageUnlike cffile action="upload", which uploads only one file at a time cf fileaction="uploadall" uploads multiple files thereby eliminating the need to code multiple cffile action="upload" statements. Use this tag in the page specified by the action attribute of a cffileupload control. This tag uploads save the files that the cffileupload control sends when the user clicks the Save File button. After a file upload is completed, this tag creates an array of structures specified by the result parameter. Each structure in the array contains upload result information for one file. For information on the result structure contents, see cffile action = "upload". Note: You can control the maximum file size of the upload
by specifying the server Request Throttle Threshold or the Settings
page of the Administrator Server Settings section.
ExampleThe following example copies files uploaded by a cffileupload tag to a temp directory. <cfif isdefined("form.submit")>
<cffile action="uploadall" destination="#expandpath('./upload')#">
</cfif>
<cfform action="#cgi.script_name#" enctype="multipart/form-data">
<cfinput type="file" name="attachment1"><br>
<cfinput type="file" name="attachment2"><br>
<cfinput type="file" name="attachment3"><br>
<cfinput type="submit" name=" submit" value="submit">
</cfform>
|