Uploading multiple files with ColdFusion

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


Now this will be a great application! We've been looking around but have been unhappy with what we've seen so far.

Put me on the list when this one comes out :-]
GiuliaN said:
Is your project ready, I might ask? Because I am trying hardly to find a way to upload multiple images to a directory using CF and all the time it processes only one image.
Thank you!
Any updates on this?
Dan said:
@Demetrius: Hi Demetrius, we did finish this product and added all the above plus more! There are some nice hooks to allow developers to ost upload code such as update a database, resize the images etc.

You can view the tag here: http://www.cftagstore.com/tags/flashmultipleupload.cfm
Hey Dan, the evaluation link doesnt work. I cannot get the entire zip folder.
ketan said:
Is there a link to dl this?

I have some doubts about CF ProFlash Upload.

Is its possible to get the selected files name even before uploading them? Just in case user forget to upload the files and move to some other page.

How can we call the upload function of the CF ProFlash Upload without clicking the "upload" button?

We are thinking of integrating CF ProFlash Upload in our application. what before that we have to make sure it provides the functionality which we are looking for.

If anyone of you have solution for these, then plz mail me.

Thank You,
Rajan G
Foster Wheeler