User Guide
cffile 125
Usage
After a file upload is completed, you can get status information using file upload parameters. The
status parameters use the
cffile prefix; for example, cffile.clientDirectory. Status
parameters can be used anywhere other ColdFusion parameters can be used.
Note: The file prefix is deprecated, in favor of the cffile prefix. Do not use the file prefix in new
applications.
Tip: If your page is uploading a file that was selected on a form or was otherwise sent to your page via
a multipart/form-data HTTP message, you can determine the approximate size of the file by checking
the value of the CGI.content_length variable. This variable includes the file length plus the length
of any other request content.
The following file upload status parameters are available after an upload.
mode Optional Applies only to UNIX and Linux. Permissions. Octal values of
chmod command. Assigned to owner, group, and other,
respectively. For example:
• 644: Assigns read/write permission to owner; read
permission to group and other
• 777: Assigns read/write/execute permission to all
attributes Optional Applies to Windows. A comma-delimited list of attributes to
set on the file.
If omitted, the file's attributes are maintained.
Each value must be specified explicitly. For example, if you
specify
attributes = "readOnly", all other attributes are
overwritten.
• readOnly
• hidden
• normal (if you use this option with other attributes, it is
overridden by them)
Parameter Description
attemptedServerFile Initial name ColdFusion used when attempting to save a file
clientDirectory Directory location of the file uploaded from the client’s system
clientFile Name of the file uploaded from the client’s system
clientFileExt Extension of the uploaded file on the client system (without a period)
clientFileName Name of the uploaded file on the client system (without an extension)
contentSubType MIME content subtype of the saved file
contentType MIME content type of the saved file
dateLastAccessed Date and time the uploaded file was last accessed
fileExisted Whether the file already existed with the same path (Yes or No)
fileSize Size of the uploaded file
fileWasAppended Whether ColdFusion appended uploaded file to a file (Yes or No)
fileWasOverwritten Whether ColdFusion overwrote a file (Yes or No)
fileWasRenamed Whether uploaded file renamed to avoid a name conflict (Yes or No)
Attribute Req/Opt Default Description