Dan Mackey On ColdFusion Development

ColdFusion, Java, .NET, AJAX, DHTML development and general programming. Daniel is owner and Administrator of CFTagStore.com and works for an Application Development Company in Ireland called Digital Crew. His interests cover all areas of programming in multiple languages with a particular interest in Internet Technologies.

2006-05-29 13:25:00.0

Uploading multiple files with ColdFusion

One of the most common annoyances about ColdFusion is the way the file upload functionality is implemented. Unlike ASP, PHP, JSP etc, file uploading is not handled by the Application Server (ColdFusion) but is farmed out to the webserver (IIS or Apache etc)

This means that while the file is being uploaded, ColdFusion just kinda sits there waiting for the file to be uploaded and a reference to the file handed back to CF. This means that you cant use some of the upload tricks of ASP, PHP etc to show the progress of the upload etc

Over the years, Peter and myself have tried to find a way of accomplishing this on the server side but to no avail. We have tried CFX tags, Java servlets called through ColdFusion etc

Andrei Kondrashev made a good stab at it using a CFX Tag and ISAPI filter but if you are on a server where installing such beasts isnt feasible there is nothing much can be done.

We wrote an ActiveX and DHTML ColdFusion component to allow multiple file uploads but the disadvantage is that it is IE only for selecting multiple files all at once. The DHTML interface is cross-browser and will uploaded multiple files but still requires you to add each file seperatley.

With the introduction of Flash 8, the problem is now achievable. ColdFusion will still use the webserver to upload the file so server side analysis of the file upload progress is still a no-no but using a Flash Component, DHTML and some clever programming, we can select and upload multiple files and give user feedback on the file upload progress.

I am tasked with designing the interface, the methods required, functionality and documentation and Peter is going to do the actual Flash programming.

Together we are finally going to solve this annoying problem and will be releasing our solution on CFTagStore.com for others to purchase and use in their applications.

Using Flash is beneficial for the following reasons:

  • Client side checking of file size instead of waiting for a PFO from the server after the upload
  • Select multiple files using SHIFT/CTRL or drag a selection using mouse
  • Available to all browsers on all platforms
  • Interface with Javascript for customisation and control such as event handlers etc
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [7] - Leave a comment