User Guide
324 Chapter 17 Managing Files on the Server
You enter permissions values in the mode attribute for each type of user: owner,
group, and other in that order. For example, use the following code to assign read
permissions for everyone:
mode=444
To give a file or directory owner read/write/execute permissions and read only
permissions for everyone else:
mode=744
Evaluating the Results of a File Upload
After a file upload is completed, you can retrieve status information using file upload
variables. This status information includes a wide range of data about the file, such
as the file’s name and the directory where it was saved.
Although you can use either the File or cffile prefix, for file uploaded status variables,
cffile is preferred; for example, cffile.ClientDirectory. (The File prefix is retained for
backward compatibility.) You can use the file status variables anywhere that you use
ColdFusion variables.
The following table describes the file status variables that are available after an
upload:
Variable Description
attemptedServerFile Initial name ColdFusion used attempting to save a file, for
example,
myfile.txt. See “Resolving conflicting filenames”
on page 321.
clientDirectory Directory on the client’s system from which the file was
uploaded.
clientFile Full name of the source file on the client’s system with the
file extension; for example, myfile.txt.
clientFileName Name of the source file on the client’s system without an
extension; for example, myfile.
clientFileExt Extension of the source file on the client’s system without a
period; for example, txt not .txt.
contentSubType MIME content subtype of the saved file, such as
gif for
image/gif.
contentType MIME content type of the saved file, such as
image for
image/gif.
dateLastAccessed Date that the uploaded file was last accessed.
fileExisted Indicates (Yes or No) whether the file already existed with
the same path.
fileSize Size of the uploaded file.