Name

CFFILE

Synopsis

<CFFILE>

Operates on files on the ColdFusion server. The action taken depends on the ACTION attribute. Append appends additional text to the end of a file. Copy copies a file from one location to another. Delete deletes a file from the server. Move moves a file from one location to another. Read reads a text file and stores the contents in a variable. ReadBinary reads a binary file and stores the object in a variable. Rename renames a file on the server. Upload uploads a file from a form submission. Write writes a text or binary file to the server.

Attributes

ACTION=" action "

The action to be performed by the CFFILE tag. Required. Possible actions are: Append, Copy, Delete, Move, Read, ReadBinary, Rename, Upload, and Write.

FILE=" filename "

The full path to the file to be operated on. Required for Append, Delete, Read, ReadBinary, and Write.

FILEFIELD=" form_field "

The name of the submitted form-field (without pound signs) that contains the selected file. Required for Upload.

SOURCE=" filename "

The full path to the current location of the file. Required for Copy, Move, and Rename.

DESTINATION=" filename "

The full path to the new location of the file. Required for Copy, Move, Rename, and Upload. If you don’t include a filename, you must use a trailing slash. On Windows servers, use the backslash (\). On Unix servers, use the forward slash (/).

OUTPUT=" content "

The text to be appended to the file for Append or the content to store in the file ...

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.