144
Chapter 2: ColdFusion Tags
Usage
After a file upload is completed, you can get status information using file upload parameters. To
refer to parameters, use either the
cffile
prefix or, if you specified an alternate name in the
result
attribute, the name you specified there
.
For example, if you did not specify a name in the
result
attribute, access the
fileExisted
parameter as
#cffile.fileExisted#
.
If you set the
result
attribute to
myResult
, however, access
fileExisted
as
#myResult.fileExisted#
.
Status parameters can be used anywhere that other ColdFusion parameters can be used.
Tip:
The
result
attribute allows functions or CFCs that get called from multiple pages at the same
time to avoid overwriting the results of one call with another.
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)
result
Optional
Allows you to specify a name for the variable in which
cffile
returns the result (or status) parameters. If you do not specify
a value for this attribute,
cffile
uses the prefix ‘cffile’. For
more information, see the Usage section.
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)
Attribute
Req/Opt
Default
Description
Summary of Contents for COLFUSION MX 7 - INSTALLING AND USING COLDFUSION MX
Page 1: ...COLDFUSION MX7 CFML Reference...
Page 20: ...20 Chapter 1 Reserved Words and Variables...
Page 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Page 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Page 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Page 411: ...cftable 411 cftable body html...
Page 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Page 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Page 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Page 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Page 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Page 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 903: ...Val 903 value Is the beginning numeric name form...
Page 932: ...932 Chapter 3 ColdFusion Functions...
Page 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Page 962: ...962 Chapter 5 Application CFC Reference...
Page 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...