<cfwhat>

Thursday, December 08, 2005

Upgrading Apache commons net library in ColdFusion MX 7

After upgrading to ColdFusion MX 7 Enterprise a couple of weeks ago we started getting Java null pointer errors when using cfftp to list directory contents on our production server (Solaris). I did a bit of poking around and found that ColdFusion uses the Apache Jakarta commons net library for FTP functions. ColdFusion MX 7 ships with version 1.2.2 of the library and the current release is version 1.4.1 so I thought it might be worth upgrading to see if that fixed our problem.

To upgrade the library I stopped the cfusion JRun server and replaced the file {Jrun root}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-net-1.2.2.jar with commons-net-1.4.1.jar. After restarting the server cfftp worked fine.

Monday, December 05, 2005

cfheader and filenames with spaces


Some time ago I had a project which required file downloads using cfheader. I found that file names with spaces were being truncated by
some browsers. Recently I came across this blog entry by
Charlie Arehart from New Atlanta which provides the solution.



Instead of

<cfheader name="Content-Disposition" value="attachment; filename=a text file.txt">

use

<cfheader name="Content-Disposition" value='attachment; filename="a text file.txt"'>