Enabling Java Servlet Directory Browser in Coldfusion 9 Administrator

When you first install CF9 you’ll soon notice that any administration page that offers to let you browse the directory structure will give you an I/O error.

This file browsing servlet requires RDS to function. The RDS servlet is disabled by default. It should be disabled on a production server, but if you’d like to use this feature you’ll need to un-comment the servlet call in your server’s web.xml.

In my case this file was located at F:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\web.xml but I’m running multiserver. Your’s could be under your CF9 install directory if you’re running CF as a standard install.

Un-comment these two servlet definition blocks in web.xml.


Now restart your CF server instance and navigate back to the administration page you were wanting to use.


Coldfusion Method to Convert a Query to CSV

I’ve been working with Magento recently and finally came to the point where I needed to import data from MSSQL into Magento’s MySQL. First idea in the pipe was to use build an exporter in our existing CF arcetecture and import the resulting output using Magento’s DataFlow profiles.

I’ve since decided to fore go that setup and go for the gold with Magento’s API (that’s a story for another time!). But while still working on that short lived DataFlow import idea found my self needing to convert a CF query object into CSV. Some Googling lead me to Ben Nadal’s place and some example code.

I’ve since modified his code to fit my purposes and present it here for your purusement. The main difference between Ben’s snippet and my own is the use of script syntax and I’m just looping over query.columnlist for the header row rather than passing in a list of column names. I didn’t need to limit columns returned in the CSV