Description
Uploads all files sent to the page in an HTTP request to a directory on the server.
Returns
An array of struct that provides the file upload status.For details of what the struct contains, see the Usage Section of cffile action = "uploadAll".
Function Syntax
FileUploadAll(destination)
FileUploadAll(destination, accept)
FileUploadAll(destination, accept, nameConflict)
History
ColdFusion 11: Added ContinueOnError and Errors attribute.
ColdFusion 9.0.1: Added this function.
Parameter
Value |
Description |
---|---|
destination |
Path of directory in which to upload the file. If not an absolute path (starting with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, returned by the function getTempDirectory. |
accept |
Limits the MIME types to accept. Comma-delimited list. For example, the following code permits JPEG and Microsoft Word file uploads:{{"image/jpg, application/msword"}}The browser uses the filename extension to determine file type. |
nameConflict |
Action to take if file has the same name of a file in the directory.
|
Added in ColdFusion 11:
Value | Required | Default | Description |
ContinueOnError | Optional | False | By default, when uploading one of the files fail, the remaining files will not be uploaded. If this value is set to true, file upload continues evern after encountering an upload error. A file upload error happens due to the following reasons: 1. Empty file In the case of an upload failure, the error details will be stored in the errors attribute. |
Errors | Optional | cffile.uploadAllErrors | The name of the variable in which the file upload errors will be stored. Errors will be populated in the specfied variable name when continueOnError is true.After the file upload is completed, this tag creates an array of structures that contains upload failure information for each upload failure. The upload failure information error structure contains the following fields:
|
See also
Usage
cffile action = "uploadAll"