Cffile Action="Upload - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 1: ColdFusion Tags

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
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"
The MODE attribute applies to ColdFusion on Solaris and HP-UX, only.
47

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents