Description:-

Copies a file to a directory on the server. Manages interactions with server files. <cffile> this function’s various purposes use require different attributes.

<cffile
    action = "upload" 
    allowedExtensions = "comma-separated list of file extensions"
    destination = "full pathname" 
    fileField = "form field" 
    accept = "MIME type|file type" 
    attributes = "file attribute or list" 
    mode = "permission" 
    nameConflict = "behavior" 
    result = "result name"
    strict = "true|false"
    ContinueOnError = "true|false"
    Errors = "variable in which the file upload errors will be stored"
>

Attributes:-

action:- This a required argument, the type of file manipulation that the tag performs.

allowedExtensions:- This is a non-required argument, A comma-separated list of file extensions, which will be allowed for upload.

destination:- This a required argument, location path of the directory in which to upload the file.

fileField:- This is a non-required argument, Name of form field used to select the file.

accept:- This is a non-required argument, we can limit the MIME types to accept. It is a comma-delimited list.

attributes:- This is a non-required argument, that applies to Windows. A comma-delimited list of attributes to set on the file.

mode:- This is a non-required argument, this applies only to UNIX and Linux. Permissions. Octal values of chmod command. Assigned to owner, group, and other, respectively.

nameConflict:- This is a non-required argument, this will operate if the filename is the same as that of a file in the directory.

result:- This is a non-required argument, this allows you to specify a name for the variable which cffile returns the result (or status) parameters. If you do not specify a value for this attribute, cffile uses the prefix cffile.

strict:- This is a non-required argument,
for false value If you provide a file extension in the attribute accept, the extension overrides the blocked extension list in the server or application settings. The file then gets uploaded. If you provide a MIME type in the attribute accept, and the extension of the file you are trying to upload is blocked in the Administrator/Application-level settings, the file does not get uploaded.

for true value If the mime type is specified in the accept attribute, the file does not get uploaded if the extension is blocked in the server or application settings. For example, if you have blocked file type CFM in the ColdFusion Administrator and specified accept=”text/x-coldfusion” and strict=”true”, and you try uploading a cfm file, the file does not get uploaded.

ContinueOnError:- This is a non-required argument, by default, when uploading a file fails, the remaining files will not be uploaded. If this value is set to true, file upload continues even after encountering an upload error.

Errors:- This is a non-required argument, the name of the variable in which the file upload errors will be stored. Errors will be populated in the specified variable name when continueOnError is true. After the file upload is completed, this tag creates an array of structures that contain upload failure information for each upload failure.