ColdFusion
CFFTP Transfers a Zero-Byte File and Throws a Timeout Error
Although I’ve used ColdFusion for 7+ years now, I’ve never used the cfftp tag before. Yesterday, I found a reason to try it out. I figured it would be as simple as cfhttp–and it was, with one exception (no pun intended).
Here is my sample code:
<cfftp action="open"
connection="test"
server="ftp.osric.com"
username="chris"
password="********************"
timeout="60"
stoponerror="yes">
<cfftp
connection = "test"
action = "getFile"
name = "downloadFile"
transferMode = "binary"
localFile = "S:\chris\handlebar-moustache.jpg"
remoteFile = "handlebar-moustache.jpg"
timeout="60">
Here’s the error message it produced:
An error occurred during the FTP getFile operation.
Error: getFile operation exceeded timeout.
However, the local file was still created (as a zero-byte file).
The solution, in my case, was to turn on passive mode (add attribute passive="yes" to the cfftp tag).
Active FTP vs. Passive FTP, a Definitive Explanation has a brief explanation of the differences between active and passive FTP.
Checking for date-time conflicts
It seems like I’ve worked on a lot of applications lately that involve time slots: room reservation systems, appointment schedulers, and so on. One thing that tripped me (and some other developers) up at first was checking for conflicting time slots. It turns out, there are a variety of possible conflicts:

There are 5 unique conflicts possible, and it seems like I’m always forgetting one.
Object Overhead in ColdFusion
I have been trying to improve the speed of a ColdFusion application. It was written by a part-timer, a Java developer who was new to ColdFusion. He wrote the code almost entirely in cfscript, and he used CFC objects extensively. In fact, it seems that he overused CFC objects—to the point where the server slows to a crawl.
Pages
Archives
- January 2012
- December 2011
- November 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- January 2011
- November 2010
- May 2010
- March 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008