Adobe COLDFUSION 9 Manual page 1252

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<cffile action="Upload"
fileField="Form.FiletoUpload"
destination="c:\uploads\"
nameConflict="Overwrite"
accept="image/gif, image/jpeg">
Note: If you receive an error like "The MIME type of the uploaded file (image/jpeg) was not accepted by the server", enter
to accept JPEG files.
accept="image/jpeg"
This
tag saves any image file, regardless of the format:
cffile
<cffile action="Upload"
fileField="Form.FiletoUpload"
destination="c:\uploads\"
nameConflict="Overwrite"
accept="image/*">
Setting file and directory attributes
In Windows, you specify file attributes using
directory permissions using the
Windows
In Windows, you can set the following file attributes:
• Hidden
• Normal
• ReadOnly
To specify several attributes in CFML, use a comma-separated list for the
attributes="ReadOnly,Hidden"
maintained. If you specify any other attributes in addition to Normal, the additional attribute overrides the Normal
setting.
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
• 4 = read
• 2 = write
• 1 = execute
You enter permissions values in the
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.
attributes
attribute of the
mode
cffile
. If you do not use the
attribute correspond to octal values for the UNIX
attribute for each type of user: owner, group, and other in that order. For
mode
Last updated 8/5/2010
attribute of the cffile tag. In UNIX, you specify file or
or cfdirectory tag.
attributes
attribute, the existing attributes of the file are
attributes
chmod
attribute; for example,
command:
1247

Advertisement

Table of Contents
loading

Table of Contents