ColdFusion Express is an introductory version of ColdFusion that allows you to use basic ColdFusion functionality. When you need the more advanced ColdFusion features, you can upgrade to ColdFusion Enterprise or ColdFusion Professional.
ColdFusion Express 4.5 for Windows
To install and use ColdFusion Server 4.5 Express edition on Windows, your system must meet the following minimum requirements:
ColdFusion Express 4.5 for Linux
To install and use ColdFusion Server 4.5 Express, Professional, or Enterprise edition on Linux, your system must meet the following minimum requirements:
ColdFusion Express, as with other editions of ColdFusion, supports any ODBC database. However, the Express installation process installs the following drivers, which we know to work very well with ColdFusion:
Windows:
Microsoft drivers are supplied for Access, FoxPro, Visual FoxPro, Excel, FileMaker Pro ODBC, and text data sources.
Linux:
Merant drivers are supplied for dBase, MySQL, PostGres, and text data sources.
When installing ColdFusion on Linux, note the following considerations:
New functions | |
JSStringFormat | Returns a JavaScript-safe string |
XMLFormat | Returns an XML-safe string |
ToString | Converts values to strings |
GetFunctionList | Returns list of supported functions in ColdFusion |
URLDecode | Decodes a URL-encoded string |
Hash | Converts a variable-length string into a 32-byte, hexadecimal string |
Duplicate | Returns a clone, also known as a deep copy, of a variable |
GetHTTPTimeString | Converts a date-time object to a string |
GetMetricData | Returns Windows NT PerfMonitor and Linux CFStat data |
Changes to CFML | |
New HTTP_IF_MODIFIED_SINCE variable | New CGI variable enables browser-side caching |
New groupCaseSensitive attribute | Case-insensitive grouping in CFOutput |
Changes to CFAPPLICATION | New SetDomainCookies attribute |
Expanded CFQUERY Text Field Support | Removes limitation on retrieval of text or long varchar database fields |
Variable Scope Enhancements | Affects URL, CGI, FORM, and Cookie variables |
Returns a string that is safe to use with JavaScript.
JSStringFormat(string)
Where string
is any string.
JSStringFormat escapes special JavaScript characters, such as the single quote (’), double quotes ("), and newline character so that you can put arbitrary strings safely into JavaScript.
Returns a string that is safe to use with XML.
XMLFormat(string)
Where string is any string.
XMLFormat escapes special XML characters, such as the less than (<) and greater than (>) signs so that you can put arbitrary strings safely into XML.
Attempts to convert a value of any type, including a binary value, into a string.
ToString(any_value)
Where any_value
is the value that is to be converted into a string.
If ToString cannot convert the value into a string, it throws an exception.
A new function, GetFunctionList(), is available in ColdFusion. It returns a structure of functions that are available in ColdFusion. For example, the following code can be used to display the list of functions in ColdFusion.
<cfset fList = GetFunctionList()> <cfoutput>#StructCount(fList)# functions<BR><BR></cfoutput> <cfloop collection="#fList#" item="key"> <cfoutput>#key#<BR></cfoutput> </cfloop>
URLDecode(urlEncodedString)
urlEncodedString
A string that has been URL-encoded.
URL encoding refers to a data format where all high ASCII and non-alphanumeric characters are encoded using a percent sign followed by the two character hexadecimal representation of the character code. For example, a character with code 129 will be encoded as %81. In addition, spaces can be encoded using the plus sign (+).
Query strings in HTTP are always URL-encoded.
URL-encoded strings can be created using the URLEncodedFormat function.
Here's an example of the URLDecode and URLEncodedFormat functions. In the example, a string containing all ASCII character codes in the range 1-255 is created. The string is then encoded and decoded. The decoded value is compared with the original string to demonstrate their equality.
<cfscript> // Build string s = ""; for (c = 1; c lte 256; c = c + 1) { s = s & chr(c); } // Encode string and display result enc = URLEncodedFormat(s); writeOutput("Encoded string is: '#enc#'.<br>"); // Decode and compare result with original dec = URLDecode(enc); if (dec neq s) { writeOutput("Decoded is not the same as the encoded."); } else { writeOutput("All's well on the Western front."); } </cfscript>
Takes a variable-length string and converts it into a 32-byte, hexadecimal string, using the MD5 algorithm. The MD5 algorithm is a one-way hash, meaning that there is no conversion from the hash result back into the source string.
Hash(string)
string
Any string.
The result of the Hash function is a fingerprint of the original data. This fingerprint can be used for comparison and validation purposes. For example, a developer could store the hash of a password in a database without exposing the password itself. Later, the developer could check the validity of the password with the following code:
<CFIF Hash(Form.Password) IS NOT MyQuery.PasswordHash> <CFLOCATION URL="unauthenticated.cfm"> </CFIF>
<!--- This code fragment illustrates how to use the Hash function for password validation. This example assumes that the UserID value was passed to this page with a URL parameter.---> <HTML> <HEAD> <TITLE> Hash Example </TITLE> </HEAD> <BODY BGCOLOR=silver> <H3>Hash Example</H3> <CFQUERY NAME="CheckPerson" DATASOURCE="UserData"> SELECT PasswordHash FROM SecureData WHERE UserID=<CFQUERYPARAM VALUE="#UserID#" CFSQLType="CF_SQL_CHARVAR"> </CFQUERY> <CFIF Hash(Form.Password) IS NOT CheckPerson.PasswordHash> <CFLOCATION URL="unauthenticated.cfm"> <CFELSE> ... </CFIF> ...
GetMetricData returns all the internal data that is otherwise displayed in the Windows NT PerfMonitor or using CFStat on UNIX. For it to work on NT you need to have turned on the PerfMonitor feature from the ColdFusion Administrator.
GetMetricData(mode)
In addition to supporting "PERF_MONITOR" for NT, GetMetricData now supports three additional values:
The following code uses the four modes.
<CFSET pmData = GetMetricData( "PERF_MONITOR" )> <CFSET yourLoad = GetMetricData( "SIMPLE_LOAD" ) > <CFSET prevRequestTime = GetMetricData( "PREV_REQ_TIME" )> <CFSET averageReqestTime = GetMetricData( "AVG_REQ_TIME" )> <CFOUTPUT> Load: #yourLoad#<BR> Previous Request Time: #prevRequestTime#<BR> Average Request Time: #averageRequestTime# <P>Current PerfMonitor data is: </P> InstanceName: #pmData.InstanceName# <BR> PageHits: #pmData.PageHits# <BR> ReqQueued: #pmData.ReqQueued# <BR> DBHits: #pmData.DBHits# <BR> ReqRunning: #pmData.ReqRunning# <BR> ReqTimedOut: #pmData.ReqTimedOut# <BR> BytesIn: #pmData.BytesIn# <BR> BytesOut: #pmData.BytesOut# <BR> AvgQueueTime: #pmData.AvgQueueTime# <BR> AvgReqTime: #pmData.AvgReqTime# <BR> AvgDBTime: #pmData.AvgDBTime# <BR> CachePops: #pmData.CachePops# <BR> </CFOUTPUT>
The Duplicate function returns a clone, also known as a deep copy, of a variable. The copied variable contains no reference to the original variable.
Duplicate(variable_name)
variable_name
The name of the variable that is to be duplicated.
This function is very useful in duplicating complex structures, including nested structures and queries. You cannot duplicate a COM, CORBA or JAVA object returned from the CreateObject function. If any element in an array or field of a structure is a COM, CORBA, or JAVA object, you cannot duplicate the array or structure. If you try to duplicate an object of this sort, an exception is thrown.
<!--- This example shows the use of Duplicate ---> <HTML> <HEAD> <TITLE> Duplicate Example </TITLE> </HEAD> <H3>Duplicate Example</H3> <CFSET s1=StructNew()> <CFSET s1.nested = StructNew()> <CFSET s1.nested.item = "original"> <CFSET copy=StructCopy(s1)> <CFSET clone=Duplicate(s1)> <!--- modify the original ---> <CFSET s1.nested.item = "modified"> <cfoutput> <P>The copy contains the modified value: #copy.nested.item#</P> <P>The duplicate contains the original value: #clone.nested.item#</P> </cfoutput> </BODY> </HTML>
The GetHttpTimeString function takes a ColdFusion date/time object, and returns that time formatted as a string according to the HTTP standard described in Request For Comments (RFC) 1123.
GetHttpTimeString(date_time_object)
date_time_object
A ColdFusion date-time object.
The time in the returned string is automatically adjusted to be Greenwich Mean Time (GMT) for consistency with the HTTP standard.
GetHttpTimeString <CFOUTPUT> #GetHttpTimeString("#Now()#")#
</CFOUTPUT>
A new CGI variable is available called "HTTP_IF_MODIFIED_SINCE" which can be accessed in ColdFusion pages via our CGI scope as "CGI.HTTP_IF_MODIFIED_SINCE".
This variable is sent at the discretion of the browser usually in response to the server having sent the LAST_MODIFIED HTTP header. It can be used to take advantage of browser-side caching.
A new attribute, groupCaseSensitive, has been implemented in the CFOutput tag. As a boolean, its value determines whether grouping is case-sensitive or case-insensitive. The default is TRUE to maintain backward compatibility.
groupCaseSensitive will only work if the recordset has been grouped appropriately already. CFOutput/CFMail will perform no re-grouping or re-sorting on the recordset.
The SetDomainCookies attribute allows applications to set the CFID and CFTOKEN cookies on the domain (i.e., .allaire.com) level.
Usage: SetDomainCookies="Yes/No"
There are some caveats to using this.
The CFMAGIC cookie contains the ID and token values, and if these don't agree with the values in the cookies, it assumes these are host level cookies, removes them, and sets the domain level cookies to be the values provided in the CFMAGIC value.
This release removes the 65K limit on the retrieval of text or long varchar database fields. The interface provides new data source settings in the ColdFusion Administrator; it does not require new CFML tags or tag attributes. For backward compatibility, the new field size is implemented so that existing applications can continue to work as they did in 4.0.
The text feature is part of the CFSettings on the ODBC page. An Enable retrieval of long text checkbox has been added to the page. The option is unchecked by default. When the option is checked, ColdFusion will retrieve the entire text field column and any subsequent columns in the select list as unbound data. A Long Text Buffer Size option has also been added to the cfsettings. The default value is 65,000 bytes, the current maximum size used by ColdFusion. You can change this value for retrieving either bound or unbound text fields. If you specify a size that is not supported by the database, then a SQL execution error will occur. The limit is database-specific and there is no way to dynamically determine the limit. When the Enable retrieval of long text is checked, the unbound column is returned in chunks equal to the Long Text Buffer Size. If not checked, ColdFusion will bind text columns to a buffer which has a buffer size equal to the Long Text Buffer Size. This allows ColdFusion to exceed the previous limit of 65k but not suffer the performance cost of retrieving unbound data.This feature is very useful if you have large text fields and know the limits of the text column. This is an important consideration for limiting your bound long text data, since many databases do not support the substring functions for this data type.
If you have a limited number of cases in which you want to retrieve complete long text data, then you should create a data source definition using the Enable retrieval of long text option so you will not incur the overhead of retrieving large amounts of data when this is no intended. Retrieving unbound data is much slower than bound data, so you should order the columns in your select statement with the text fields referenced last.
The statement
SELECT integer_col, char_col, date_col, long_text_col FROM data_table
is more efficient than
SELECT long_text_col, integer_col, char_col FROM data_table.
In the first statement only the long_text_col is retrieved as unbound data and the other columns are retrieved as bound data, while in the second statement all the columns are retrieved as unbound data.
URL, CGI, FORM, and Cookie variables can now be accessed through structure objects with the same names. These names are now reserved for use by CFML. This enhancement makes these scopes behave the same as application, session, and request.
This has not been done with the Server scope partially for security reasons - so that server variables whose names are unknown cannot be accessed. It has also not been done with the Client scope because of the performance implications of having to enumerate all persistent variable names.
Note that if you used these variable names for other purposes you may need to rename your variables to avoid conflicts that could break your code.
Error Occurred While Processing Request Error Diagnostic Information An error has occurred while processing the expression: DateFormat(date,"mmm dd yyyy")
<cfscript> st1=structnew(); variables.st1.key="foo",</cfscript>
For example, single decimal point numeric data such as "0.1," "21.6667", multiple decimal point numeric data, such as "1.2.3", and comma separated data, such as "0,1" create unexpected results. To work around this behavior, it is always advisable to only pass string data in a supported format to the IsDate and ParseDateTime functions, or, generate date-time data using the Now or CreateDate functions.
ColdFusion Express supports the euro currency. Two special functions, LSEuroCurrencyFormat() and LSParseEuroCurrency() have been added to CFML for this purpose. The euro currency symbol in a .cfm file will be parsed correctly by ColdFusion Express. For the euro currency symbol to be properly displayed, the system needs to be euro-enabled. Visit the Microsoft Web site for information on configuring your system for euro currency symbol input and display.