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.
Demo currently unavailable
Lets take a look at how simple the code is
fileupload1.cfm:
1<cffileupload
2 name = "uploadDemo"
3 url="uploadSelectedFiles.cfm"
4 progressbar="true"
5 addButtonLabel = "Select File(s)"
6 clearButtonLabel = "Clear"
7 width="500"
8 height="400"
9 title="Multi File Upload Demo"
10 maxUploadSize="1"
11 maxFileSelect="10"
12 extensionfilter="*.txt,*.jpg,*.png,*.doc"
13 uploadButtonLabel="Upload"
14 >
2 name = "uploadDemo"
3 url="uploadSelectedFiles.cfm"
4 progressbar="true"
5 addButtonLabel = "Select File(s)"
6 clearButtonLabel = "Clear"
7 width="500"
8 height="400"
9 title="Multi File Upload Demo"
10 maxUploadSize="1"
11 maxFileSelect="10"
12 extensionfilter="*.txt,*.jpg,*.png,*.doc"
13 uploadButtonLabel="Upload"
14 >
uploadSelectedFiles.cfm:
1<cffile action = "uploadAll" destination = "c:\temp\" nameConflict = "MakeUnique">
Very Simple, very easy.
#1 by sandy on 1/6/10 - 4:06 PM
I tried it today only. Its rocking.
Thank you
#2 by Matthew on 1/13/10 - 11:44 AM
#3 by Kumar on 1/13/10 - 7:43 PM
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">
#4 by Matthew on 1/14/10 - 11:11 AM
#5 by Ray Majoran on 1/16/10 - 1:04 PM
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).
#6 by Juan Manuel on 2/20/12 - 12:45 PM