I just read a post on an Adobe Forum regarding how to upload a file to a server (ColdFusion) from a Flex UI. This post isn't so much a how to accomplish such a task, per se; rather, it's to make available a custom MXML component I wrote for just such a task. I've made a Zip archive available for download with the necessary components to add this feature to any Flex UI (link after the post). 

The Zip archive contains three files: FileUpload.mxml, SampleUsage.mxml, fileUpload.cfm

This is the actual upload component that allows a user to search his/her computer for a file, select it and upload it to the server. Visually, this component creates a form item (the component itself extends mx:FormItem) and can be easily plugged into any Flex form. 

This component is merely an example of how to integrate the FileUpload component into your Flex UI. 

This could just as easily have been a CFC but I felt like the basic CFM page was easier for demonstration purposes because this page could just as easily be a PHP file or some other server-side tool. The script itself simply receives the form data from the Flex UI and uploads the file to the appropriate location on the server, which is part of the data supplied by the Flex UI. 

I debated writing up how to use this component but, instead of making anyone reading this slog through my instructions, I have commented the code in the three aforementioned files heavily. If you have any questions or issues running this, feel free to let me know!

Zip Archive:

Hope this helps!


Craig Kaminsky
@Nassi: Thanks, very much. Glad you found it helpful!
Wow. Really helpful. Thanks a ton
Craig Kaminsky
New zip archive URL:
It seems that the zip file link is broken.
Tried downloading the Zip. It seems the page no longer exists. Can you plz update the link ... thanks :)
Craig Kaminsky
@anon2: Awesome! I'm glad it helped and thanks for letting me know :)!!
Perfect! Just what I needed without a bunch of research and testing. :-)
Craig Kaminsky
It sounds like you need a cross domain XML file at your web root. This would tell the Flash Player that you're 'allowed' to access resources on the server.

Googling 'cross domain file flash' should get you tons of info!
I get the following error: SecrityError #2148 which says my SWF cannot access local resouces