<cffile action = "upload"           fileField = "formfield"           destination = "full_path_name"           nameConflict = "behavior"           accept = "mime_type/file_type"           mode = "permission"           attributes = "file_attribute_or_list">  <cffile action = "move/rename/copy/delete"           source = "full_path_name"           destination = "full_path_name"           mode = "mode"           attributes = "file_attributes_list"           charset = "charset_option">  <cffile action = "read/readBinary"           file = "full_path_name"           variable = "var_name"           encoding = "encoding_option"           charset = "charset_option">  <cffile action = "write/append"           file = "full_path_name"           output = "content"           mode = "permission"           addNewLine = "Yes" or "No"           attributes = "file_attributes_list"           encoding = "encoding_option"           charset = "charset_option" > 


Used to work with files on the server on which ColdFusion is installed. The action performed depends on the action attribute. For this tag to work, it must be enabled in the ColdFusion Administrator.


action (Required)

The type of action that the tag performs, including upload, move, rename, copy, read, delete, readBinary, write, and append.

fileField (Required)

Name of form field used to select the file. Do not use pound signs to specify the field name.

destination (Required)

The absolute path name of a directory or file on the web server.

nameConflict (Optional)

Default: error

Action to take if filename is the same as that of a file in the directory.

  • error. File is not saved. ColdFusion stops processing the page and returns an error.

  • skip. File is not saved. This option permits custom behavior based on file properties.

  • overwrite. Replaces file.

  • makeUnique. Forms a unique filename for the upload.

accept (Optional)

You can limit the types of files that can be uploaded with this attribute. If you want to allow multiple file types, they should put into a comma-delimited list.

mode (Optional)

Applies only to Solaris and HP-UX. Enacts permissions and allows use of the chmod command. For example:

  • 644. Assigns read/write permission to owner and read permission to group and other.

  • 777. Assigns read/write/execute permission to all.

attributes (Optional)

This enables you to set file attributes on a file. You can only set one attribute for Windows files. You can set a list of attributes for other platforms. Options include readOnly, hidden, and normal.

source (Required)

Absolute path name of a file on the web server.

charset (Optional)

Default: ISO-8859-1, which is the Java character set name used for the file contents.

file (Required)

Absolute path name of a file.

variable (Required)

Name of variable to contain contents of text file.

encoding (Optional)

Default: (ISO-8859)-1, which is the character encoding of generated output. Any valid character encoding is usable.

output (Required)

Content of the file to be created.

addNewLine (Optional)

Default: Yes, which appends newline character to text. After a file upload is completed, you can get status information using the file upload parameters listed next. The status parameters use the cffile prefix; for example, cffile.clientDirectory. Status parameters can be used anywhere other ColdFusion parameters can be used. The upload parameters include the following:


Initial name ColdFusion used when attempting to save a file.


Directory location of the file uploaded from the client's system.


Name of the file uploaded from the client's system.


Extension of the uploaded file on the client system.


Name of the uploaded file on the client system.


MIME content subtype of the saved file.


MIME content type of the saved file.


Date and time the uploaded file was last accessed.


Whether the file already existed with the same path.


Size of the uploaded file.


Whether ColdFusion appended an uploaded file to a file.


Whether ColdFusion overwrote a file.


Whether the uploaded file was renamed to avoid a name conflict.


Whether ColdFusion saved a file.


Size of the file that was overwritten during the file upload operation.


Directory of the file saved on the server.


Filename of the file saved on the server.


Extension of the uploaded file on the server.


Name of the uploaded file on the server.


Time the uploaded file was created.


Date and time of the last modification to the uploaded file.

Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579 © 2008-2017.
If you may any questions please contact us: