User Guide

Table Of Contents
Using cfcontent 1015
Changing the MIME content type with cfcontent
You use the
cfcontent tag to change the MIME content type that returns to the browser along
with the content generated from your ColdFusion page.
The
cfcontent tag has one required attribute, type, which defines the MIME content type
returned by the current page.
To change the MIME content type with cfcontent:
1.
Create an HTML page with the following content:
<h1>cfcontent_message.htm</h1>
<p>This is a <em>test message</em> written in HTML.</p>
<p>This is the <em>second paragraph</em> of the test message.
As you might expect, it is also written in HTML.</p>
2.
Save the file as cfcontent_message.htm in the myapps directory under your web_root.
This HTML file will be called by the ColdFusion file that you write in steps 3 through 7.
3.
Create a ColdFusion page with the following content:
<html>
<head>
<title>cfcontent Example</title>
</head>
<body>
<h3>cfcontent Example</h3>
<cfcontent
type = "text/html"
file = "C:\CFusionMX7\wwwroot\myapps\cfcontent_message.htm"
deleteFile = "No">
</body>
</html>
4.
If necessary, edit the file = line to point to your myapps directory.