Chapter 1: ColdFusion Tags
47
CFFILE ACTION="Upload"
Use CFFILE with the Upload action to upload a file specified in a form field to a
directory on the Web server.
Note
The MODE attribute applies to ColdFusion on Solaris and HP-UX, only.
Syntax
<CFFILE ACTION="Upload"
FILEFIELD="formfield"
DESTINATION="full_path_name"
NAMECONFLICT="behavior"
ACCEPT="mime_type/file_type"
MODE="permission"
ATTRIBUTES="file_attributes">
FILEFIELD
Required. The name of the form field that was used to select the file.
Note
: Do not use pound signs (#) to specify the field name.
DESTINATION
Required. The full path name of the destination directory on the Web server where
the file should be saved. A trailing slash must be included in the target directory
when uploading a file. Use the backward slash (\) on Windows ; use the forward
slash (/) on UNIX.
Note
: The directory does not need to be beneath the root of the Web server
document directory.
NAMECONFLICT
Optional. Default is error. Determines how the file should be handled if its name
conflicts with the name of a file that already exists in the directory. Valid entries
are:
•
Error — Default. The file will not be saved, and ColdFusion will stop processing
the page and return an error.
•
Skip — Neither saves the file nor throws an error. This setting is intended to
allow custom behavior based on inspection of FILE properties.
•
Overwrite — Replaces an existing file if it shares the same name as the CFFILE
destination.
•
MakeUnique — Automatically generates a unique filename for the upload. This
name will be stored in the FILE object variable "ServerFile. " You can use this
variable to record what name was used when the file was saved.
ACCEPT
Optional. Use to limit what types of files will be accepted. Enter one or more
MIME types, each separated by comma, of the file types you want to accept. For
example, to allow uploads of GIF and Microsoft Word files, enter:
ACCEPT="image/gif, application/msword"
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...