Tags: ColdFusion. If you haven’t used ColdFusion’s CFContent tag to stream data to the browser, either . Pratik Sanyal Jan 8, at AM. Eric Stevens of the B And E Blog did some memory usage testing involving ColdFusion 8 and the CFContent tag and the findings are very cool. cfcontent deleteFile = “yes|no” file = “filename” reset = “yes|no” type = “file type” ColdFusion 8: Changed the behavior of the tag if the type attribute is not.
|Published (Last):||17 April 2011|
|PDF File Size:||1.7 Mb|
|ePub File Size:||11.56 Mb|
|Price:||Free* [*Free Regsitration Required]|
Changed the behavior of the tag if the type attribute is not specified and the file attribute is specified. To request the browser to display the file directly, use a cfheader tag similar to the following:. 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.
The text displays as unformatted text, in which HTML tags are treated as text: Sends the contents of a file, or of a variable that contains binary data, as the page output.
For example, the browser could open a spreadsheet program when it encounters a file identified by its MIME content type as a spreadsheet file. When using cfabort, cflocation, or cfcontent tags, the OnAbort method is invoked instead on OnRequestEnd.
For more information on character encodings, see the following web pages:. Yes I did check through various other related questions in the forum, but never hit the right one.
You can use this tag to set the MIME type of the content returned by a ColdFusion page and, optionally, define the filename of a file to be downloaded by the current page.
Replacing one error message with another is not really a solution ;- Increased security features make newer versions of Excel far less tolerant of the old “trick the browser into thinking html is a spreadsheet” trick. 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 MIME content type of the page, optionally followed by a semicolon and the character encoding. The following are some of the content type values that you can use: If you specify a file or variable attribute, this attribute has no effect; otherwise, it does the following: Excel coldfusioj the table format. The user is prompted with an option to save the cfconteht or open it in the browser.
Adobe ColdFusion 8
For more information, see the Administrator online Help. You can use the cfcontent tag to override the default character encoding of the response. Because Excel can include executable code, the browser prompts the user whether to save the file or open it in a browser. The MIME content type of the page, optionally followed by a semicolon and the character encoding. Create an Excel spreadsheet with cfcontent Create a ColdFusion page with the following content: A MIME type is a label that identifies the contents of a file.
You can use any value for the filename ocldfusion of the filename attribute, but the ext part must be the standard Windows extension for the file type. Applies only if you specify a file with the cfvontent attribute. 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.
Bottom line, your first suggestion is the better option, ie create a true spreadsheet. The cfcontent tag downloads files from the server to the client. If a file delete operation is unsuccessful, ColdFusion throws an error.
To request the browser to display the file directly, use dfcontent cfheader tag similar to the following:. Excel converts the table to a spreadsheet.
Sets the MIME content encoding header for the current page; if the encoding information includes a cvcontent encoding, sets the character encoding of generated output. The following are some of the content type values you can use include: Some file types, such as PDF documents, do not use executable code and can display directly in most browsers. In this case, all output is sent with the specified type.
When using ColdFusion in a distributed configuration, the file attribute must refer to a path on the system on which the web server runs. Edit Not being sarcastic, but did you do a search on that error message before posting?
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. Name of an on-disk or in-memory file whose contents provide the page output. If you specify a file or variable attribute, this attribute has no effect; otherwise, it does the following: Some will still have problems with it.