File Upload with ColdFusion Flash Forms
364 comments Posted by: Laura
At last! File upload was, in my opinion, one of the most important missing features for Flash RIAs to be taken seriously. One of the reasons we couldn’t reproduce HTML forms with Flash CFForm was the file upload. But now that the new Flash Player has file I/O features, we can use it to incorporate them to Flash forms, and make it even better than regular file upload, with more user feedback such as progress bars. As you may expect, you need the Flash Player 8 to run this example. In the zip file you will find a custom tag, an example, and a swf file.
We have implemented most of the I/O methods provided by the new API, and use them to add a progress bar and some progress information such as percentage and total bytes uploaded.
The custom tag consists of two tags, an enclosing cf_flashUpload, and an inner tag, cf_flashUploadInput.
This is the simplest example on how to use the custom tag, with default values:
<cf_flashUpload name="defaultInput" actionFile="upload.cfm">
<cf_flashUploadInput />
</cf_flashUpload>
A more complex example would be:
<cf_flashUpload label="Picture" name="myFile2" fileTypes="*.jpg;*.png;*.gif" fileDescription="Image files" actionFile="upload.cfm">
<cf_flashUploadInput buttonStyle="corner-radius: 0;" inputStyle="fontWeight:bold" inputWidth="80" uploadButton="true" uploadButtonLabel="Upload Label" chooseButtonLabel="Choose file" progressBar="true" progressInfo="true" />
</cf_flashUpload>
flashUpload Usage:
Attributes:
- name: Required; Name of the text input that will contain the name of the file to upload
- actionFile: Required; File that will handle the upload. It can include query string variables to identify this file. Example: upload.cfm?id=15
- label: Label to put next to the control.
- fileTypes: extensions to accept, separated by semicolons. Example: *.jpg;*.png;*.gif
- fileDescription: Text to describe accepted files
- maxSize: maximum file size in Kb to upload. Defaults to no limit
- swf: name of the swf file that contains the i/o libraries. Only needed if your swf is not in the same dir as your cfform
flashUploadInput Usage:
Attributes:
- inputWidth: with of the text input where file name is shown
- buttonStyle: style applied to choose and upload buttons
- uploadButton: true/false, default true. Adds an upload button. If you set it false, you must put the generated variable called “theNameOfYourInput_uploadScript” in some other button (“theNameOfYourInput” is the name assigned in the flashUpload tag name attribute)
- progressBar: true/false default true. Adds a progress bar.
- progressInfo: true/false default true. Adds an output area to show progress info
- progressBarStyle: style of progress bar
- uploadButtonLabel: label of “Upload” button
- chooseButtonLabel: label of “File browse” button
Notes on error codes:
404: As you may know, 404 means "file not found". As such, it means that the address you are sending the upload to does not exist or it cannot be found by the web server. You will need to make sure you are pointing the "actionFile" attribute to the right place. When in doubt, try using an absolute path (ie: /myuploads/directory/upload.cfm)
500: This error could be due to many things, but it is an "Internal server error". Issues to check:
- You are uploading files larger than the allowed post size set in the CF administrator. See the setting "Maximum size of post data" in the Settings page of the CF administrator. The default I think is 100MB
- You are uploading large files and CF is running out of memory. CF has to put the whole size in memory while it gets uploaded before it saves it to disk. If you have access to the logs (the java output logs, not the regular cf logs), check for this error.
A couple of notes from the comments:
Posting additional data: handling a file upload posted by Flash is different than handling an upload posted by an html form. The first difference is that you cannot specify the name of the file input, it will always be "FileData". The second difference is that when you trigger the file upload, you are only sending the file contents and the file name, but cannot send anything else, whether it was in the form you have or not. That is, on your "form" scope in upload.cfm, you will only see those two fields. The only data you can send is what you append to the upload action file name query string (ie: upload.cfm?variable1=test), and you will get that in the URL scope of upload.cfm.
Getting data back from the upload action page: The only things you will get from the upload action page are HTTP status codes. 200 will mean the upload was successful (or that at least there was no server error). If you change the file name, make a query to retrieve anything (ie: an id), you will not be able to send that back to the calling page. You can do any of that, for example if you wanted to send an email after a file was uploaded, or resize the image you uploaded, as this is a normal cfm page, but you cannot communicate any of this to the calling page.
An update on this: If your user is running player 9.0.28, you could get information back from the upload action page. You will have to, however, change the .fla that implements the uploading. See the docs.
View live example (please be gentle with our bandwidth)
Download the source
364 Comments so far
Write yoursI just want them to take the size limit off of their flash forms, there is no reason it should be on there and there is no documentation saying there is.
Maybe you can submit a bug about this.
Thanks!
I don't seem to be able to get it to work otherwise.
Remember, google is our friend... ;o)
There is an attribute called swf in the flashUpload tag where you can tell it where your swf is located. I only used it with absolute path (ie: /blog/examples/fileUpload.swf) but I believe it should work with relative path too.
Thanks for the response though.
You would hope so until you go into livedocs and read "this bug will be fixed in the next release"
... what exactly are you talking about. Will something be "taken away" from us?
It seems whenever a bug is reported in livedocs, the developer says it will be fixed in the next release of ColdFusion.
This behavior has always bothered me, but now I am in the ColdFusion MX 7 Updater Beta program so things are looking up.
Strange problem:
I am adding data to a table using remoting and I get the following error (from handler.onStatus): "Error while calling cfc: Service app.services.facade does not have a method addData that matches the name and parameters provided." However it adds the data correctly. Here is what I am doing... In the facade file I have a addData function that looks for the arguments method (string used in switch statement to determine what function to call in another cfc) and fields (structure that hold all fields passed in). Then I have an action script function that is pretty much exactly like the one in this example to call the facade function. In my cfm file, on the click event I call the as function with following code:
_global.addRecord({
gridName:myGrid,
method:'addContract'
fields:{
idn:selectBox.selectedItem.data,
number:number.text,
(etc....)
}
});
Any ideas??? Is there a problem with my fields structure? I am trying to make the facade function more dynamic by passing a structure instead of individual args... Like I said it is inserting the record correctly just throwing that error... So it is running the function or the row wouldn't be added... What causes the handler.onStatus section to execute? I am trying to returning a result to get the primary key of the added record, but it is running the cfc function and return a status instaed of the result.
Thanks,
Brian
Look at the last example in the zip file, where you can trigger the upload from any other button you choose. If you want to trigger multiple uploads, just keep pasting the generated variables (theNameOfYourInput_uploadScript) in your onclick of the button of your choice.
I cant get a working example of having multiple file upload fields and one submit button.
Do I just add more <cf_flashUploadInput> tags?
I would like to end up with having 5 files fields and one button to do the action.
me.
You need the Flash Player 8 to run this example
We made a new post showing how to show a picture after uploading it
http://www.asfusion.com/blog/entry/showing-an-image-after-upload
I am also find the solution on how to update the upload file. Do you have the solution on that?
thank you!
Thanks.
Invalid content type: "application/x-www-form-urlencoded".
CFFILE action="upload" requires forms to use enctype="multipart/form-data".
how can finish this problem?
Thanks
Anyone have any ideas?
any help will be appreciated
also I need to see how I could stop people from printing my pictures from my swf file and xml www.theassociates.tv
thank you
This is a great script, thank you so much!
I have just integrated the tag into my cfform and it's browsing for the file which is great!
Please could someone tell me if/how you can alter the buttons and input so they dont wrap? I would like to try to get them to merge into the rest of the form without looking like it's been placed on top.
Many thanks,
and keep up the great work!
Matt
you can try specifying the width of the text input until it doesn't wrap.
<cf_flashUpload ...>
<cf_flashUploadInput inputWidth="150" />
</cf_flashUpload>
To change the destination folder just write your desired absolute path in the destination attribute (without the #s). expandpath is just a shortcut to get the current directory path. I used that so that the example would work as is when downloaded.
Paulo,
You are using the regular html form with input type="file", if you are, then you need to write
<cfform enctype="multipart/form-data" ....>
SaeedR,
Your upload action page has a problem. You need to check it, It could be either not even compiling (can you even browse that file without getting errors?) or not working with the data you are sending to it. I would recommend that you make a test with a regular html file upload to see what the problem is, then when all fixed, make the change to flash forms.
NRR,
yes, that can be done. We'll make an example when we get a chance.
Yes, I added "_root.submitForm();" in the onComplete listener. See my example below:
<cfif attributes.progressInfo>uploadListener.onComplete = function(){
output.text = "Upload complete";
_root.submitForm();
}
</cfif>
Is there any way to change the location of the action page in your script (the upload.cfm page)?
I think I may need to specify another page to run as the action page instead to get the results and extra queries that I need, but I cannot seem to be abel to find where the upload.cfm page is specified in the code.
Any help would be greatly appreciated!
Many thanks
Sorry! :)
Also, is I cancel the file dialog but then choose to 'browse...' again, all the listeners fire twice on each event. The listeners fire as many times as you've had the browse dialog open.
This needs to be improved.
Great job though
Please can someone tell me if I can enable the upload button to be active at all times, instead of only being displayed if a file has been selected in the browse section?
many thanks
I am sooo almost there with what I needed this form to do. Only one thing holding me back now, and I would really REALL appreciate help on this one (my job may depend on it..)
The actionfile uploads the files, and makes unique in case of duplication.
In my form, the form data is then inserted into a database to store the filename and location on server.
However, if the file was renamed using cffile, the new "unique" filename is not being transferred to the database, just the original filename in the input box.
Please please please does anyone now how I can change this so that if the file is renamed on the server side, the new name is sent to the database?
I tried cffile.serverfile, but as the actionfile is a separate page, I dont know how to transmit that data to the form action page that inserts data into the database.
Please please please?
That certainly seems to be a bug.
Asher,
I haven't seen that behavior. I'll ask Nahuel if he can take a look. Regarding the *.* search, is this in Windows? I can't make the search dialog appear in Windows and it works fine in Mac.
Matt,
To enable the upload button all the time, set disabled="false" in line 128 and remove lines 69 and 75.
As of now, there is no way to send data back to the calling page.
You will have to make sure the file you are uploading does not get renamed. I usually do that by sending a unique id and naming the file with it.
(Thanks much for the response earlier, too.)
I have the prerequisite versions of browsers and OSX, every example i have found on the web (~8), and written myself, throws an IO error.
All work fine on WINXP IE,Netscape etc. I am however running OSX under PEARPC (poor developer, and this customer only has macs), is this my problem?
Next step tracing the network!
Yes, this work on mac, but only on OSX.
Make sure that the machine has the latest player( 8 ) installed
// Action script...
// [Action in Frame 1]
function addListener(listener)
{
imageFile.addListener(listener);
} // End of the function
function browse(list)
{
imageFile.browse(list);
} // End of the function
function upload(path)
{
return(imageFile.upload(path));
} // End of the function
var imageFile = new flash.net.FileReference();
Drag and drop from the desktop to the browser is something that flash does not support yet.
I have been having a nightmare today with the code.
It has worked fine until today when I noticed an error being generated.
If I try to upload a file over my production server, I receive a securitySandboxError message in the form.
However, if I try on my localhost server, the upload works.
Does anyone know of any discrepancies with the Flash Player that could have caused this?
I have checked the Sandbox settings on my server, and they arent even turned on, and it looks as though everything is as it should be.
Many thanks
That seems to happen when you try to upload to a domain different from where the swf is. Otherwise, I don't know what it may be causing it.
Mode,
Check this post as an example of renaming the file:
http://www.asfusion.com/blog/entry/showing-an-image-after-upload
Thanks
I'm new to MX7, and have no clue what I'm doing wrong.
Does the demo file from above 'download the source' work straight out of the box, or do I need to add some extra settings? (like custom tag info).
MX7 is running on a Linux server, and I do understand that I have to CHMOD some dir's, but again.. the site (index.cfm) does not even load! (other sites do)
I found the problem..
The 'Default CFFORM ScriptSrc Directory' in my MX7 & linux setup was set wrong!
After playing with it, I got it to work..
This is a question that is not directly related to the upload of a file but to "Force a Download of a file". I have it working outside the flash forms but within the flash form if I have a link to a file type of (doc,ppt,zip, etc any file type). In IE 6.0 it does not show me the screen where it asks you "Do you want to open or save this file etc. etc. But instead it the browser shows an error saying "Action canceled
Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable." If I reload the page I get the Dialog box "Do you want to open or save this file". ANy idea why this is happening only in Internet Explorer and not Firefox and Netscape. Any ideas on how to force a file download from flash forms is appreciated. Thanks a lot
I have tried by adding the following in the uploadListener.onComplete = function()
<!--- start added stuff for redirect --->
getURL("http://www.domainname.com");
<!--- end added stuf for redirect --->
The getURL does not work :-(
Anyone here who might have a hint, on how I can get this done?
>How do I make it required like I can a input field?
I updated the custom tag to allow for required and message attributes (to be added to flashUploadInput inner tag). However, if they write something into the text field, it will validate even though it was not uploaded. You will have to do something fancier for that or even disable the field (but that's not included in the tag)
Shivang,
> In IE 6.0 it does not show me the screen where it asks you "Do you
> want to open or save this file etc. etc. But instead it the browser
> shows an error saying "Action canceled
I don't know, this is working for me in both browsers:
<cfformitem type="html"><a href="myfile.zip">Download zip</a></cfformitem>
You might want to check your web server.
Tony,
> I've tried it in FuseBox and can't get it to work
I can't really help you with the info you provided. Paths are the same as if you would browse the file with your browser, be it a swf, or a cfm. If it works in your browser it should work here, although absolute paths are preferred.
Noel,
> The getURL does not work
Use _root.getURL("http://www.example.com");
Erik,
> I am unable to get it to work as I am unable to designate the
> enctype to multipart/form-data
This is not using <cfinput type="file"> therefore it does not need the form-urlenconded format. If you are using this tag, hence a flash form, it should work as is. Download the example and try to run it to see if it works for you. The other person *was* using cfinput type file in a regular html form and that is why he needed the encoding type. If you want to know how this tag works, check
http://www.asfusion.com/blog/entry/file-upload-explained-and-expanded
FYI, I'm using FuseBox MVC
all the files (upload.cfm ,flashUploadInput.cfm, flashUpload.cfm, fileUpload.swf) are in the /view/pages
I change the path as follow:
<cf_flashUpload actionFile="view/pages/upload.cfm">
and
<cfparam name="attributes.swf" default="view/pages/fileUpload.swf">
It shows "HTTP Error number:404"
when the progressBar done uploading
Did I miss out anything?
If you use relative path for the actionFile, it will be relative to the location of the swf, so I think in your case it should simply be upload.cfm. I would recommend though that you use absolute paths ("/your/path") to avoid any confusion.
Mizuno,
If you have Flash Player 8, there shouldn't be a problem. I suggest that you check whether the form is able to load the fileUpload.swf file.
I do have Flash Player 8...downloaded it for this purpose. I have not used an .swf with a Flash Form before so I am not sure what to look for as far as whether it is loading correctly or not. Any help is appreciated.
Thanks
I've been trying absolute and relative path for both, same error keep showing up at the end of uploading.
I tried all:
actionFile=/view/pages/upload.cfm
actionFile=view/pages/upload.cfm
actionFile=upload.cfm
actionFile=http://#cgi.HTTP_HOST#/myapp/view/pages/upload.cfm
Thanks!
You can use this extension in Firefox http://livehttpheaders.mozdev.org/ or Fiddler for IE to see if the file is called and it doesn't get a 404
I don't know what the problem is. Try using Fiddler (LiveHttpHeaders does not show the Flash form post) and see what file is calling and why it is getting a 404.
THe problem is, I am not declaring any enctype, and it still throws that error. I too am using Fusebox but i doubt that would have anything to do with it. I will continue to fiddle with it. Best,Erik
Got everything working fine on my local dev environment, upload to live environment and I get a Javascript error
When I run your demo source code I get the same error -
Line: 29
Char: 1
Error 'lc_id' is undefined
Code: 0
URL: ...
Anyone shed some light on this?
I had the same problem some time back when I used this example. What you need to do is in the CFAdmin "Default CFFORM ScriptSrc Directory" Make sure that the path to the scripts directory is correct. I have it deployed on WebLogic and my path was all messed up and was getting the same error lc_id not defined. If you have given a context root then It needs to be there in the path. In my case I have / as my context root so this is what my path looks like: /CFIDE/scripts/.
Hope this helps..
how do i integrate the file upload element with other cf form elements.
essentially i want to upload a file an pass that files name and other form values into a database via remoting?
I never experienced that problem but I heard it happens if the browser cannot access the cfide/scripts file. Check that you are able to browse the files in that directory.
Daz,
Check this post:
http://www.asfusion.com/blog/entry/showing-an-image-after-upload
You can have the file name in a hidden field and then send all the form items by submit or via remoting.
I keep getting an IO error on larger files. By large I am talking about greater than 150mb. No slow down of upload real pattern appart from more than 64mb. I have watched the server and nothing seems off there either, the upload just seems to stop.
Help!
So what is causing a pause every 64mb?
Coldfusion mx7 Enterprise (windows).
Firefox and IE
Thanks
Steve
Is there any examples of sending via remoting as opposed to receiving, as the only posts I can see all talk about receiving.
Thanks For Your Help
Daz
However, when another user (non admin) tries to upload they receive a 401 error. I have opened it up to them as far as I can and they still get the error. They can directly save to the folder, but cannot save via the upload process. They are asked to authenticate each time they try to upload a file but receive the 401 error even with proper credentials.
What I would prefer to do is to have the repository for uploaded files to reside on another server. This would allow me play around with rights a little more as far as who can write to the folders, etc. I have given an example directory structure below and under it pose some facts and questions.
SERVER1
=======
root
..level1dir1 (documents)
..level2dir1 (department)
..level3dir1 (office)
SERVER2
=======
root
..level1dir1
..level1dir2
..level1dir3 (inetpub)
..level2dir1
..level2dir2 (wwwroot)
..level3dir1
..level3dir2
..level3dir3 (intranet)
..level4dir1
..level4dir2 (documents)
..level4dir3
..level4dir4 (upload folder)
1) Upload intranet site resides on SERVER 2 in the 'upload folder'.
2) Using code 'As Is' results in file being uploaded to 'upload folder'.
3) Altering UPLOAD.CFM by changing 'destination="#expandpath(".")#"' to 'destination="#expandpath(".")#/../level4dir2"' results in files being uploaded to documents directory on SERVER 2.
Q1) How do I change this line of code to specify a location on another server as the repository for uploaded files? i.e. I want the files to be saved to SERVER 1 into folder OFFICE.
Any help will be appreciated.
SERVER1
=======
root
..level1dir1 (documents)
....level2dir1 (department)
......level3dir1 (office)
SERVER2
=======
root
..level1dir1
..level1dir2
..level1dir3 (inetpub)
....level2dir1
....level2dir2 (wwwroot)
....level3dir1
....level3dir2
....level3dir3 (intranet)
......level4dir1
......level4dir2 (documents)
......level4dir3
......level4dir4 (upload folder)
Just my problem is that i'm on a co-hosted site so i don't have a cf-tag directory but i'd like to use the cfmodule. Should this be how I am referencing it:
<cfmodule template="/webs/02005/cftags/cfform_fileUpload/fileupload.cfm" name="cf_flashupload">
In this sort of way?
I managed to get it to work but i had to have my CFTAGs in the same directory as where my form was.
Anyhow, i'm on to a new problem now. I am trying to insert a query on the upload.cfm page. Should this be possible?
<cfif structkeyexists(form,"Filedata")><!--- upload file with whatever attributes you need, additional variables may come in url scope --->
<cffile action="UPLOAD" filefield="Filedata" destination="#expandpath(".")#" nameconflict="MAKEUNIQUE">
<cfquery name="AddImage" datasource="user020">
INSERT INTO tbl_020eventImages (eventID)
VALUES (#form.eventID#)
</cfquery>
</cfif>
Should this be possible to add the value #form.eventID#? eventID is a field which is also in the form where my cf_flashupload tag is.
Should upload.cfm be able to receive the parsed form variables?
It's saying error 500 in the progress bar after it's finished uploading. It's fine without my query. After testing it appears it can't read #form.eventID#. But should it?
Any help i'd be very grateful.
Thanks,
It was working fine outside of my password protected area, but when I move the code over behind a login framework, I get the log in form displayed (which I discovered through Fiddler) -- the file never gets uploaded.
I think maybe the .fla file doesn't authenticate or something maybe? I'm not sure! :o
This is a bug from the flash player. As far as we know, it only happens in firefox. You should submit a bug to Macromedia, we have already reported it but they will be more likely to fix it if a lot of people request it.
It is not possible to send any form variable directly to the upload action page. Only url variables are allowed (appended to the action url). Check this example (with filename renamed) to see how to do it: http://www.asfusion.com/blog/entry/showing-an-image-after-upload
Jason,
When we first encountered the problem I tried a workaround that didn't work. For some reason, most likely the CF Updater, it is now working. Append the session variables to the action page url. Use the same example I told Stuart above. Use a hidden field: <cfinput type="hidden" name="sessionvars" value="#session.urltoken#">
and append that to the url. If you are using the custom tag it would be something like
actionFile='upload.cfm?" + myForm.sessionvars + "'
Regarding your first question about cfmodule, the syntax would be:
<cfset params = structnew()/>
<cfset params["name"] = "myPictureField" />
<cfset params["actionFile"] = '/myRoot/upload.cfm' />
<cfmodule template="/webs/02005/cftags/cfform_fileUpload/fileupload.cfm" attributeCollection="#params#">
<cfmodule template="/webs/02005/cftags/cfform_fileUpload/flashUploadInput.cfm" />
</cfmodule>
The problem is that the custom tag requires a name attribute, but that conflicts with the name attribute of cfmodule, so you need to use attributeCollection.
First, thanks for the follow up response.
I tried your suggestion, and was unable to make it work. I suspect maybe there is a version difference between my version of CF and yours. Could you tell me what yours is? The server I am hosted on is running 7,0,1,116466 which is the 6.1 updater - so I don't think there is a newer one out there.
The only other option I can think of is possibly the way my application.cfm is structured is causing the problem.
Here's how I called the tag - it successfully sent the CFTOKEN and CFID values according to Fiddler, but I still get the log in box.
<cf_flashUpload name="productImage" actionFile="uploadImage.cfm?#SESSION.urltoken#&itemID=#URL.itemID#"><cf_flashUploadInput progressBarStyle="#progressBarStyle#" buttonStyle="#buttonStyle#" inputWidth="150" />
</cf_flashUpload>
<head><title>JRun Servlet Error</title></head>
<h1>500 Corrupt form data: premature ending</h1>
<body>Corrupt form data: premature ending</body>
Sorry for so many posts. ><
You are not using the accept attribute of cffile, right?
Regarding the updater, I have the same version as you, but I just remembered that I also applied the cffile hotfix that was released shortly after the updater (hf70160996_cffile_upload.jar).
Once you have it working (hopefully you will), transfer the session and itemId vars to a hidden field, otherwise your form will recompile each time one of those change.
I'll speak to my server host about the hot fix and see if that helps. :) Thanks for the info!
I'll also get the variables passed via hidden fields, thanks for that tip!
I'm using this great piece in a Fusebox application and it works. I've seen that some people have problem with it, so here how I configured it:
In my case, upload.cfm is in the same folder as the caller page. I am uploading in a folder "images" which is at the site root
actionFile = "upload.cfm"
and in my upload.cfm page:
destination="#expandpath('../images')#"
I hope it will help you guys!
-------
On another hand, I have a small question.
I'd like to update a datagrid field with the image name after having clicked "Choose file" and..well, chosen a file.
I tried to bind a text input to the img_name field, and then apply an "onChange" action to this input, but it doesn't work.
I can't seem to find where I could modify the CFtag code to launch an action after having chosen the file... Any idea?
And thanks again for your great work, which often saves my day.
You may want to try one of these posts:
http://www.asfusion.com/blog/index.cfm?mode=entry&entry=1F1D08FE-3048-525A-B25E7A5D4D8EF256
http://www.asfusion.com/blog/entry/showing-an-image-after-upload
http://www.asfusion.com/blog/entry/thumbnails-in-cfgrid
They should help you out....
I never thought of using the "show image after upload" code to do this... I got pretty blind with my eyes glued to my own code. Ouch!
Thanks a lot Todd!
I'm glad it work for you! btw, which version of FB you using?
I'm in FB4.1 MVC
Thanks guys
Scrach some of that, now I just need help on adding input text fields to the flash uploader for descriptions for that image thats being uploaded...
I read all the posts and found the section for the multiple file uploads, now i need help on this one.
What wysiwyg editor/programs do you use to edit this 'cfflash' stuff?
I am using 'Dreamweaver' and 'Notepad', but they do not really work for layout stuff.
You can only send variables through url query string. Otherwise, you can submit the form to get the additional image data.
Noel,
We can't recommend you anything as we code them by hand using Eclipse or CF Studio. But you could try Flex builder and try to translate it to cfform.
I think I've figured out you can make this work on Fusebox (I'm using 4.1 as well).
I'm gonna try to make it simple...
First, check this line in flashUpload.cfm:
<cfparam name="attributes.swf" default="path_to_folder/fileUpload.swf">
the "path_to_folder" thing must be in the fusebox way, i.e. if your swf is in the folder "admin" which is at the root, you just put "admin/fileUpload.swf".
Then, in upload.cfm:
what I hadn't figured out before, is that the path is relative to the previous param. For instance, in my case, I upload files to a folder named "docs" which is also at the site root. So I use this destination path: #expandpath('../docs/')#
I hope this time it helps you, tell me if you still have problems!
Thanks,
Danny Young