User Guide

Table Of Contents
1008 Chapter 41: Managing Files on the Server
UNIX
In UNIX, you can individually set permissions on files and directories for each of three types of
users—owner, group, and other. You use a number for each user type. This number is the sum of
the numbers for the individual permissions allowed. Values for the
mode attribute correspond to
octal values for the UNIX
chmod command:
4 = read
2 = write
1 = execute
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 status
variables. This status information includes data about the file, such as its name and the directory
where it was saved.
You can access file upload status variables using dot notation, using either file.varname or
cffile.varname. Although you can use either the File or cffile prefix for file upload status variables,
cffile is preferred; for example, cffile.ClientDirectory. The File prefix is retained for backward
compatibility.
Note: File status variables are read-only. They are set to the results of the most recent cffile
operation. If two
cffile tags execute, the results of the first are overwritten by the subsequent cffile
operation.
The following table describes the file upload status variables that are available after an upload:
Variable Description
attemptedServerFile Initial name that ColdFusion uses when attempting to save a file; for
example, myfile.txt. (see “Resolving conflicting filenames”
on page 1006).
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.
clientFileExt Extension of the source file on the client’s system without a period; for
example, txt (not .txt).
clientFileName Name of the source file on the client’s system without an extension; for
example, myfile.
contentType MIME content type of the saved file; for example,
image for image/gif.