User Guide

Table Of Contents
1003
CHAPTER 41
Managing Files on the Server
The cffile, cfdirectory, and cfcontent tags handle browser and server file management
tasks, such as uploading files from a client to the web server, viewing directory information, and
changing the content type that is sent to the web browser. To perform server-to-server operations,
use the
cfftp tag, described in “Performing file operations with cfftp” on page 999.
Contents
About file management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
Using cffile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
Using cfdirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012
Using cfcontent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014
About file management
Macromedia ColdFusion MX lets you access and manage the files and directories on your
ColdFusion server. The
cffile tag has several attributes for moving, copying, deleting, and
renaming files. You use the
cfdirectory tag to list, create, delete, and rename directories. The
cfcontent tag lets you define the MIME (Multipurpose Internet Mail Extensions) content type
that returns to the web browser.
Using cffile
You can use the cffile tag to work with files on the server in several ways:
Upload files from a client to the web server using an HTML form
Move, rename, copy, or delete files on the server
Read, write, or append to text files on the server
You use the
action attribute to specify any of the following file actions: upload, move, rename,
copy, delete, read, readBinary, write, and append. The required attributes depend on the
action specified. For example, if action="write", ColdFusion expects the attributes associated
with writing a text file.