cffileupload Tag - Uploading Multiple Files

Back in beta, I had made a post on this new tag in ColdFusion 9. It creates a Flash interface allowing the user to upload multiple files to the server. A pretty easy way to achieve something powerful. Back in beta, there was also a bug with the funtionality. It was that ColdFusion was not automatically passing back Success, Failure messages. With the release now, that has been taken care of, so we can revise the beta code.

Have a look at the Demo

Lets take a look at how simple the code is

fileupload1.cfm:

   view plainprintabout
 <cffileupload
     name = "uploadDemo"
     url="uploadSelectedFiles.cfm"
     progressbar="true"
     addButtonLabel = "Select File(s)"
     clearButtonLabel = "Clear"
     width="500"
     height="400"
     title="Multi File Upload Demo"
10      maxUploadSize="1"
11      maxFileSelect="10"
12      extensionfilter="*.txt,*.jpg,*.png,*.doc"
13      uploadButtonLabel="Upload"
14      >

uploadSelectedFiles.cfm:

   view plainprintabout
 <cffile action = "uploadAll" destination = "c:\temp\" nameConflict = "MakeUnique">
Very Simple, very easy.
Comments
sandy's Gravatar Cool stuff !!!!!!!
I tried it today only. Its rocking.
Thank you
# Posted By sandy | 1/6/10 4:06 PM
Matthew's Gravatar Apparently it doesn't like variables used in the directory path. I don't get it to work if I use a variable from query.
# Posted By Matthew | 1/13/10 11:44 AM
Kumar's Gravatar Matthew,

I don't know what exactly you are trying, but having the path declaration in a variable worked for me:
<cfset abc = "c:\temp\">

<cffile action = "uploadAll" destination = "#abc#" nameConflict = "MakeUnique">
# Posted By Kumar | 1/13/10 7:43 PM
Matthew's Gravatar The weird thing is I can pass a url variable to it, I can use cfset and pass a variable, but if I use a variable from a query directly it doesn't like it. I just passed a url variable to get it to work. Just remember that with the flash app it will only read hte first variable after the link and will ignore anything passed the &.
# Posted By Matthew | 1/14/10 11:11 AM
Ray Majoran's Gravatar Matthew,

Use URLEncodedFormat around it and it will work. Raymond Camedon had this problem as well and explained that if he used URLEncodedFormat, it worked just fine (and it does).
# Posted By Ray Majoran | 1/16/10 1:04 PM
iphone clone's Gravatar Good job~
# Posted By iphone clone | 1/29/10 11:25 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.5.003.  Design based on ARCLITE by: digitalnature