
File uploads enabled by Flex and Java provide a high level of interaction between the user and a web application. For example, people can use file upload to submit a résumé to a job posting or a home movie to a video sharing site. Flex offers a powerful library of tools to handle file uploads, while also providing feedback to the user on the upload’s progress.
For the server-side processing, a simple Java servlet can receive the request and write the file to storage. The request can contain additional data, providing more complex instructions to the servlet. In response, the servlet can generate XML for Flex to display the upload’s status.
This article shows how to develop a Flex and Java file upload mechanism for attaching images to an employee list. In the process, it demonstrates Flex’s ECMAScript for XML (E4X) language extension, custom components, classes, and events, as well as a Java-like properties file. In addition, the article explains packages in Java for generating XML.
In order to make the most of this article, you need the following software and files:
Working knowledge of ActionScript 3.0 and Java, specifically, compiling and running Java servlets.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
Alex Cougarman is a Web application developer at UNC-TV in Research Triangle Park, North Carolina. Alex holds a bachelor of science in computer science from UNC Wilmington, where he worked as an applications programmer and analyst. Visit Alex's blog.