cfcontent type = “file_type” deleteFile = “Yes” or “No” file = “filename” reset = ” Yes” or “No”>starting with a drive letter and a colon, or a forward or backward. cfcontent deleteFile = “yes|no” file = “filename” reset = “yes|no” type = “file type” variable Previously, ColdFusion assumed a default file type of text/html. Now. 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.
|Published (Last):||4 August 2006|
|PDF File Size:||12.22 Mb|
|ePub File Size:||13.52 Mb|
|Price:||Free* [*Free Regsitration Required]|
Configuring and Administering Adobe ColdFusion 9. Developing Adobe ColdFusion 9 Applications.
Sets the MIME content encoding header for the current page; if the encoding information includes a character encoding, sets the character encoding of generated output.
For more information, cfcontenf the Administrator online Help. Changed the behavior of the tag if the type attribute is not specified and the file attribute is specified. Now, ColdFusion attempts to get the content type from the file. Name of an on-disk or in-memory file whose contents provide the page output.
The filename must start with a drive letter and a colon, or a forward or backward slash. When using ColdFusion in a distributed configuration, the file attribute must refer to a path on the system on which the web server runs. When you use this attribute, any other output on the current CFML page is ignored; only the contents of the file are sent to the client. If you specify a file or variable attribute, this attribute has no effect; otherwise, it does the cfconent.
ColdFusion Help | cfcontent
In this case, all output is sent with the specified type. The MIME content type of the page, optionally followed by a semicolon and the character encoding. However, if the file attribute is specified, ColdFusion attempts to get the content type from the file. To set the character encoding character set of generated output, including the page HTML, use code such as the following:.
You can use the cfcontent tag to override the default character encoding of the response. For example, to tell ColdFusion to return the page using Japanese EUC character encoding, use the type attribute, as follows:. Do not use this tag after the cfflush tag on a page, it has no effect or ColdFusion throws an error. The following tag can force most browsers to display a dialog box that asks users whether they want to save the contents of the file specified by the cfcontent tag using the filename specified by the filename value.
If the user selects to open the file, most browsers open the file in the related application, not the browser window. Some file types, such as PDF documents, do not use executable code and can display directly in most browsers.
To request the browser to display the file directly, use a cfheader tag similar to the following:. You can use any value for the filename part of the filename attribute, but the ext part must be the standard Windows extension for the file type. For file types that might contain cvcontent code, such as Microsoft Excel documents, most browsers always ask before opening the document.
For these file types, the inline content disposition specification requests the browser to display the file directly if the user selects to open the file. The page at www. The page at http: This cfxontent uses Java internal names, not the IANA character encoding names that you use in the SetEncoding charset parameter and other ColdFusion attributes and parameters. For a complete list of media types used on the Internet, see www.
View Help PDF adobe. Description Does either or both of the following: Sends the contents of a file, or of a variable that contains binary data, as the page output. Category Data output tags.
See also fccontentcfheadercfhttpcfoutputcftable. Added the variable attribute. Usage To set the character encoding character ccfcontent of generated output, including the page HTML, use code such yype the following: For example, to tell ColdFusion to return the page using Japanese EUC character encoding, use the type attribute, as follows: If a file delete operation is unsuccessful, ColdFusion throws an error.
To request the browser to display the file directly, use a cfheader tag similar to the following: For more information on character encodings, see the following web pages: Notice that the graphics do not display and the hyperlinks do not work, because the html page uses relative filename references.
The root of the reference is the ColdFusion page, not the location of the html page. The user is prompted with an option to save the file or open it in the browser. Excel interprets the table format. Because Excel can include executable code, the browser prompts the user whether to save the file or open it in a browser.
See also cfcolcfheadercfhttpcfoutputcftable History ColdFusion 8: Applies only if you specify a file with the file attribute. If you specify a file or variable attribute, this attribute has no effect; otherwise, it does the following: The content type determines vfcontent the browser or client interprets the page contents. The following are some of gype content type values that you can use: