User Guide

28 CFML Language Reference
CFCONTENT
Defines the MIME type returned by the current page. Optionally, allows you to specify
the name of a file to be returned with the page.
Note The ColdFusion Server Basic security settings may prevent CFCONTENT
from executing. These settings are managed using the ColdFusion
Administrator Basic Security page. In order for CFCONTENT to execute,
it needs to be enabled on the Basic Security page. Please refer to
Administering ColdFusion Server for more information about securing
ColdFusion tags.
Syntax <CFCONTENT TYPE="file_type"
DELETEFILE="Yes/No"
FILE="filename"
RESET="Yes/No">
TYPE
Required. Defines the File/ MIME content type returned by the current page.
DELETEFILE
Optional. Yes or No. Yes deletes the file after the download operation. Defaults to
No. This attribute only applies if you are specifying a file with the FILE attribute.
FILE
Optional. Denotes the name of the file being retrieved.
RESET
Optional. Yes or No. Yes discards any output that precedes the call to
CFCONTENT. No preserves the output that precedes the call. Defaults to Yes. The
RESET and FILE attributes are mutually exclusive. If you specify a file, the RESET
attribute has no effect. See Note.
Note You should consider setting RESET to "No " if you are calling
CFCONTENT from a custom tag and do not want the tag to have the side
effect of discarding the current page whenever it is called from another
application or custom tag.
Example <!--- This example shows the use of CFCONTENT to return the
contents of the CF Documentation page dynamically to the browser.
You may need to change the path and/or drive letter.
(graphics will not display) --->
<HTML>
<HEAD>
<TITLE>
CFCONTENT Example
</TITLE>
</HEAD>