Name

cfcontent

Synopsis

<cfcontent>

Sends content of the specified media type to the browser. Content may be dynamically generated by ColdFusion or come from a file. The cfcontent tag is often used to send files stored above the web root directory to the browser or to generate non-HTML content for other clients, such as wireless devices (cell phones, PDAs, etc.).

Attributes

type=" MIME_type_and_or_charset "

The MIME type and/or character set for the content to be sent to the browser. charset lets you specify a Java character set to use for the encoding. The most common character sets are UTF-8 (the default), UTF-16, UTF-16BE, UTF-16LE, US-ASCII, and ISO-8859-1. You may use any character set supported by your JRE. If you want to specify a MIME type and a character set, delimit them with a space or a semicolon: type="text/html; charset=utf-8". Required unless file or reset is specified.

deletefile="Yes|No"

Whether or not to delete the file after it has been sent to the browser. Valid only if a file was specified in the file attribute. Optional. The default is No.

file=" filename "

The name of the file being sent to the browser. Required unless type or reset is specified.

reset="Yes|No"

Whether or not to suppress any output preceding the call to the cfcontent tag. The reset attribute is ignored if a value is specified for file or type. The default is Yes.

Get Programming ColdFusion MX, 2nd Edition 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.