pf » Tag: cfml on Pete Freitag's Blog
May 05, 2008
CFSCRIPT Cheatsheet
Last year I put together a CFSCRIPT cheatsheet for my cheatsheet collection. I just realized today, I don't think I ever blogged about it. Let me know if you find it useful or if I am missing anything.
April 05, 2008
ColdFusion 8 Update 1 Fixes some Image Processing Quirks
It was nice to see that two of the quirks that I talk about in my Image Processing in ColdFusion 8 presentation were fixed in ColdFusion 8, Update 1 - they are:The cfimage tag and image functions now retain EXIF data after operating on an image.
April 05, 2008
10 Most Useful Image Functions in ColdFusion 8
Last week when I gave my Image Manipulation with ColdFusion 8 presentation at the New York City ColdFusion Users Group, several people asked me to blog this slide.
October 26, 2007
Getting EXIF Metadata with ColdFusion 8
One example that I've been meaning to post is how to get Image Metadata using the Exchangeable Image File Format or EXIF a using ColdFusion 8. It's actually quite simple, to get a list of all the EXIF tags simply use the ImageGetExifMetaData function.
October 26, 2007
ColdFusion 8 Image Manipulation Presentation Recording
Last night I gave a presentation on Image Processing and Manipulation with ColdFusion 8 at the ColdFusion Online Meetup. The recording is now available. Charlie Arehart, the host of the ColdFusion Meetup, has also posted it on his UGTV.
September 14, 2007
CFImage Presentation Outline
I gave a presentation on ColdFusion 8's CFIMAGE tag, Image Functions, and Foundeo's CFImage Effects Component yesterday to the Albany, NY CFUG.I have made the code samples & slides available online.
August 09, 2007
CFImage Effects Library for ColdFusion 8
August 07, 2007
CFThread - Don't Abuse It
I love the fact that you can now create threads with CFML in ColdFusion 8, however as Spiderman can tell you with great power comes great responsibility.Using threads can increase the performance of your application, however using threads can also decrease performance.
August 06, 2007
Serializing CFC's in ColdFusion 8
One of the handy new features in ColdFusion 8 is that CFC's are now serializable. There isn't a whole lot of information about this new feature in the docs, but I did some playing around and it does appear that they have used Java's serialization API. This means that you can use java's java.io.
August 01, 2007
New StatusCode Attribute in CFLOCATION
When ColdFusion 7 came out I did a series of blog entries on small often overlooked new features. Well ColdFusion 8 is now out, and I thought it would be a good idea to do the same.One handy new feature in ColdFusion 8 is the statusCode attribute in the CFLOCATION tag.
April 09, 2007
Getting the Application Root Path in ColdFusion
I wrote a handy function today that will return the server file system path of the acting Application.cfm file for a ColdFusion application. It works by working its way up the directory tree until it finds an Application.cfm file. If it doesn't find one it will throw an exception.
February 05, 2007
Application.cfm and AJAX
I had someone email me with the following question today:I'm developing a ColdFusion app with Prototype. Seems Ajax.updater wants to insert my application.cfm code into my div along with responseText. How can I stop this?
This question brought up two good points.
January 10, 2007
Reverse IP Address Lookup with ColdFusion + Java
I needed to do a reverse lookup on some IP addresses in a database today. I found that you can do this pretty easily with java, and just as easily with ColdFusion. Here it is:<cfset inet_address = CreateObject("java", "java.net.
January 10, 2007
Top 10 Underrated Functions in ColdFusion
I gave a presentation at my local CFUG yesterday called 10 Underrated Functions in ColdFusion, I plan on doing one for tags as well at some point. Here was my list of functions, in no particular order:ValueList - Returns the contents of an entire query column in a string list.
September 28, 2006
What's New in BlueDragon 7?
New Atlanta, just released Beta 1 of version 7 of thier BlueDragon CFML application server.Below is a list of the new features - I think the IsNull function and null keyword will prove to be quite handy.
June 14, 2006
CFCHART Example - Pie Chart
May 31, 2006
Advanced Date Parsing with ColdFusion
Have you ever tried to parse a date that ColdFusion didn't recognize? It can be pretty tricky, and usually requires regular expressions.Suppose you want to use DateFormat on an RFC-822 date. These dates are used by the HTTP protocol, and in RSS feeds.
April 21, 2006
CFDocs.org back up and running
Several people have emailed to tell me that cfdocs.org was down. I have moved it to a different server, and it is now back up and running.If it's still not working for you give the DNS some time to propagate.
February 13, 2006
Textile for ColdFusion
A few weeks ago I mentioned that I had an open source project in the pipeline. Well I've been really busy so I haven't had a chance to release it until now...I built a UDF for converting textile markup into HTML markup.
You can learn more about textile here.
February 07, 2006
Use CFSILENT
Here's my tip for the day. If you have a choice in using either the cfsilent tag, or cfsetting enablecfoutputonly="true" use cfsilent.Here's why
Easier to type
Easier to read
The enablecfoutputonly gets very messy when used across cfincludes.
January 10, 2006
Null Java References in CF 6 vs 7
ColdFusion 7 appears to be much better at passing null values to a java object. ColdFusion 6 however likes to block you from doing it, even when you want to.I am tring to work with a java API that requires me to pass a null value to a method.
December 13, 2005
AJAX Tutorial with Prototype
Here's the AJAX prototype example that I used in my AJAX presentation today.I wanted to give an example of a good use of AJAX, and at the same time keep it simple. So I thought a good example
would be to build a zip code verifier.
October 27, 2005
DNS Query with ColdFusion
It has been a while since I've posted one of these java + cfml tricks, so here's a neat one for ya'.You can use the Java Naming and Directory Interface (JNDI) to perform a DNS query in ColdFusion.
September 12, 2005
Build a directory browser with ColdFusion
Most web servers have directory browsing disabled, but sometimes you want it to work for certain directories. Most web servers also allow you to setup specific settings for your directories for instance you could do it with an .htaccess file on Apache.
August 31, 2005
CodeFetch
CodeFetch is a clever little app that searches published books for code samples matching your search. So if you search for cfmail you will get code samples from several books on ColdFusion. You can then of course buy the books through amazon.
August 09, 2005
DateFormat, and TimeFormat mask shortcuts
Did you know that there were some date/time mask shortcuts for the DateFormat, and TimeFormat functions? They were added in ColdFusion MX 6.0, and they flew under the radar for many. I have seen them in the docs when I lookup a mask, but I always forget about them.
July 08, 2005
The client variables debacle
Nathan Strutz recently said that client variables are no good to use. From reading his entire post, he isn't saying that the concept is flawed, just the current implementation. He even suggests how they may could be improved.
June 24, 2005
How To Make a Tag Cloud
Jeffery Zeldman proclaims that tag clouds are the new mullets. However, as I'm sure you're aware some people just can't resist the mullet.
June 24, 2005
Auto-Linking Comments
To avoid comment spam, my blog comments are displayed as plain text. However urls to other entries on my blog are often posted to in the comments. So I wrote a simple regular expression to create hyperlinks out of them:REReplaceNoCase(comments.comment,
"(http://www\.
May 25, 2005
Arrays VS Structures
Array's and Structures (structures in CF are called hashtables, or associative arrays) are two very different data structures. There is some confusion about how arrays work in CF, and from what I can understand they are based on native java arrays.
May 23, 2005
Bad Error Message
I recently did this:<cfoutput query="#queryName#"> ... </cfoutput>
Can you spot the error?
I think that is probably a very common mistake - here's the error message you get in ColdFusion MX 6.
May 19, 2005
Regex to Replace Multiple Blank Lines with One
I'm working on a function to strip HTML, but preserve things like paragraph spacing. In removing HTML tags, sometimes you end up with lots of blank lines...
May 16, 2005
What CFLOCATION Does
It is often stated that CFLOCATION does a client side redirect. This means that it sends back some HTTP headers telling your browser to request a different location. This is done with a 302 (Moved Temporarily) HTTP status code, and the Location header.
May 06, 2005
ParagraphFormat is not XHTML Safe
I just noticed that the ParagraphFormat tag is not XHTML safe. It inserts unclosed <P> tags for line breaks. I posted a comment on the live docs about this, so hopefully they will add an optional argument to have it generate XHTML output.
April 13, 2005
CFFUNCTION and CFARGUMENT don't support new types in ColdFusion 7
One thing I just realized today - that is a bummer, is that the new types supported by cfparam, and IsValid (eg integer, email, zipcode) in ColdFusion 7 are not supported by the returntype attribute in CFFUNCTION, and not supported in the type attribute of CFARGUMENT. Whats up with that?
April 07, 2005
Save your self some typing
If you want to save yourself some typing, note that cf_sql_varchar is the default value for the cfsqltype attribute in the cfqueryparam tag.So you can omit the cfsqltype attribute, if your type is cf_sql_varchar at the expense of some readability.
April 06, 2005
Thread Priority, and Yielding
Suppose you have a page that is only run by background processes, or a page that can take a lot of resources, but you don't want it to. Since ColdFusion MX is written in Java, you can access the thread object that your CFML request is running as.
April 05, 2005
6 Tags for ColdFusion beginners
The ColdFusion Developers Journal has an article called: CF Six Pack by Greg Cerveny which lists 6 tags new developers should be using.I pretty much agree with all the tags on the list, except for cfsetting, I think if your a newbie, just enable whitespace suppression in the CF admin.
April 05, 2005
CFIMAP Rocks - And so does IMAP
BlueDragon's CFIMAP tag is awesome! I use IMAP for my email, and because of that I tend to store a lot of mail, especially old mailing list messages. I was telling our linux dude, Steve, that I wanted a way to remove messages in certain folders that are older than, say 30 days.
April 01, 2005
Connection Failure with Yahoo Web Services and ColdFusion
If you tried using the Yahoo Web Services with CFHTTP and your cfhttp.filecontent variable had the value: Connection Failure, or if you had throwonerror="true" and you got the error: Connection Failure: Status code unavailable it is due to an encoding issue.
March 29, 2005
Trackbacks working on my blog
I hopefully have trackbacks working on my blog now. If you want to test the methods given in my trackbacks article you can trackback to this post.Here's some code I use to check and see if my trackbacks was successful:
<cfset tbError = ReReplaceNoCase(cfhttp.filecontent, ".
March 29, 2005
Trackbacks with ColdFusion
It's pretty simple to implement trackback pings with CFML, since trackbacks are simply just a HTTP form post to a specific url. The result is an XML file.So do post a trackback to another blog, simply use CFHTTP:
<cfhttp url="http://the.trackback.
March 28, 2005
BlueDragon adds new Tags and Functions
New Atlanta's CFML engine BlueDragon was just given an upgrade to version 6.2 last week. BlueDragon has added tags that are not supported by Macromedia ColdFusion since version 3 of their product.
March 28, 2005
REFind and ReReplace support \r \n and \t
I noticed today that the regular expression functions in CF support the newline character \n Chr(10), carriage return \r Chr(13), and tab \t Chr(9).
March 23, 2005
Function to get Page Title from a URL
I wrote a simple function today that grabs a url, and parses out the title of the page from the url:
March 16, 2005
Resetting your page output
I just figured out a simple way of resetting the output stream in a coldfusion template using the JspWriter obtained from the PageContext:You won't see any content above the line below.
<cfset GetPageContext().getOut().
March 15, 2005
Hash
After a long break in my series of the little enhancements in ColdFusion MX 7 (CFMX 7 Little Things), I am back today with another article, this time with the Hash function.In versions of ColdFusion prior to 7, the Hash function used the MD5 algorithm to generate hash values.
March 11, 2005
Stopping HTTP Referer Spam with ColdFusion
I get a lot of hits from HTTP Referer spammers in my logs these days. If your not familiar with this type of spam, its pretty simple. Someone has a url that they want you to visit, so they write a spider to visit your site, but they put in their url as the HTTP referer.
February 24, 2005
Parsing Atom Dates (ISO8601) in ColdFusion
Need to parse the dates in an Atom feed? Atom feeds use ISO 8601 formatted dates, something like this; 1994-11-05T08:15:30-05:00 with a UTC offset, or like this: 1994-11-05T13:15:30Z in GMT.
February 22, 2005
Strong Encryption Technote shows undocumented features
Macromedia has just released a technote entitled: Strong Encryption in ColdFusion MX 7. It has lots of information useful to anyone planning to work with these features. In addition I noticed mention of two undocumented arguments in the Encrypt() and Decrypt() functions.
February 22, 2005
If-Modified-Since and CFML Part III
Roger Benningfield pointed out to me that most clients use a value from a Last-Modified header as the value sent in the If-Modified-Since. So you will want to ensure that you are setting that header as well, if your planning on checking for If-Modified-Since.
February 18, 2005
If-Modified-Since and CFML Part II
Now that you know how handle HTTP requests with the If-Modified-Since header in ColdFusion, lets take a look at how you might write a HTTP client using CFHTTP that sends If-Modified-Since headers:
February 18, 2005
Supporting If-Modified-Since HTTP header in CFML
The If-Modified-Since header in the HTTP protocol allows user agents (typically RSS aggregators, or Spiders) to check and see if the content they are about to download has changed since their last visit.
February 11, 2005
CFTIMER - Little things in ColdFusion 7
I am digging the new cftimer tag in ColdFusion MX 7.In previous versions when you want to time how long something takes, you would do something like this:
<cfset tick = GetTickCount()>
run your code here...
February 10, 2005
cfdirectory adds recursive support - Little Things in CFMX 7
I know I have written recursive custom tags, and functions (more than once) to solve this problem in the past, but now you can just add a simple recurse="true" to your cfdirectory tags in ColdFusion MX 7.0<cfdirectory action="list" directory="#ExpandPath(".
February 10, 2005
IsValid - CFMX 7 Little Things
ColdFusion MX 7 added a new function called IsValid. The IsValid function performs data validation just like the CFPARAM tag, and supports all the new data types in cfparam (see my previous post) as well.
February 10, 2005
ColdFusion 7 Strong Encryption
ColdFusion MX 7 adds strong encryption support to the Encrypt and Decrypt functions. In addition to the legacy algorithm used in Encrypt, and Decrypt - ColdFusion MX 7 now makes it incredibly easy to use AES, Blowfish, DES, and Triple DES encryption.
February 09, 2005
CFPARAM - New Features in CFMX 7
ColdFusion MX 7 is packed with lots of little new features, that are, well killer! I am starting a series on my blog called Little Things that Kill that will expose some of these killer new features and subtle improvements. And yes, the name is inspired by Bush (the band).
November 19, 2004
MySQL Popular among ColdFusion Developers
July 28, 2004
XPath Tool
I wrote a web based XPath tool in ColdFusion. The tool will allow you to perform an XPath query on a XML document, it then highlights the results and also dumps the XmlElement returned from the XPath query.
May 12, 2004
Bookmarklets and Search Plugins for javadocs.org
Many people have been posting bookmarklets for searching javadocs.org, and some have asked about a Mozilla/Firefox search plugin. So I though I would create a bookmarklets, and mozilla search plugins page.This page has bookmarklets that work in IE, Mozilla, FireFox, and Safari.
April 08, 2004
Parsing RSS 1.0 with ColdFusion MX
Well thanks to Sean Corfield I understand why I was having issues with namespaces when trying to parse RSS 1.0 with XPath.If you have a document with namespaces such as RSS 1.
April 08, 2004
RSS and XPath
I came across a handy reference article on xml.com today that gives XPath queries for RSS and Atom feeds. Just last week I was attempting to parse a RSS 1.0 feed in CFMX using the XMLSearch function. I'm running into problems however due to the name spaces in RSS 1.
March 31, 2004
Checking your JDBC Driver Version
Macromedia recently updated their JDBC driver technote, but I wasn't sure if I already had the 3.3 driver installed (since they may have just updated the text in the technote).
March 11, 2004
New Service - cfdocs.org - Fast access to CF docs
I just launched a new service at cfdocs.org - the site allows you to type in a ColdFusion function name or tag name directly in the url to goto the documentation, for example: http://cfdocs.org/cfchart will take you to the Macromedia Live documentation for cfchart. This is equivalent to the way php.
December 19, 2003
Regular Expressions with ColdFusion - a Howto Guide
Regular Expressions are a powerful tool for both developers and computer users alike. Regular Expressions were originally developed on Unix systems and used in programs like Perl, sed, and grep.
December 10, 2003
Determining the size of objects in memory
Someone asked for a method to find out how much memory their cached queries, and components are using on the cf-talk mailing list today. In CFMX and in java there are no build in methods for determining the size of an object.
December 04, 2003
Client Variables unnecessary overhead?
September 12, 2003
Parsing RSS with CFMX
I came up with a code sample to parse RSS with CFMX today based on a question about CFMX XML functions on my local CFUG mailing list. It should do ok with RSS 2.0, and 0.91, and also well formed RSS 0.92. It won't work with RSS 1.0.
February 28, 2003
Turning a JDBC Result set into a ColdFusion query
Recent discussion on the CFCDev mailing list (at cfczone.org) shows how to return a ColdFusion query object from a Java class using a JDBC result set (java.sql.ResultSet). The solution posed by both Brandon Purcell, and I was to pass your JDBC result set in to the constructor of the coldfusion.sql.
October 14, 2002
How to make ColdFusion MX go to sleep
Many people have had the need for a ColdFusion page to sleep, typically between iterations of a loop. There is a tag called CFX_Sleep in the Tag Gallery, but in ColdFusion MX you don't need a CFX tag to make the current processing thread sleep using the static sleep method on the java.lang.
October 08, 2002
CFC's - private works like protected
I noticed yesterday that when you use access="private" in a CFC function, inherited CFC's also have access to this function.In object oriented languages such as Java, C++, or C# this type of access is known as "protected" access.
Subscribe to my RSS Feed:
RSS
RSS
Pete Freitag is a software engineer, and web developer located in






