I'm new to Flex development, and I am using Flex 2. I have
implemented ASP.NET websites in the past that utilize an HTML
construct similar to the following:
<INPUT id="FileControl" style="Z-INDEX: 107; LEFT: 116px;
WIDTH: 568px; POSITION: absolute; TOP: 232px; HEIGHT: 24px"
type="file" size="75" runat="server">
In my ASP.NET application when they click the upload button,
I would simply check for the FileControl.PostedFile.FileName to
make sure they specified a file, and then use the
FileControl.PostedFile.SaveAs(UploadedFileName) to save the file to
the web server.
Is there a Flex 2 component that I can use to accomplish
this same kind of file uploading? If so, can someone point me to a
good sample of doing this?
Thanks in advance!
You need to use the FileReference API in ActionScript to do
the file upload. You would create a TextInput field to hold the
name of the file and a button to browse for it. The Browse button's
click event should call the FileReference browse method causing the
browser to open its File dialog box. Once the user has picked a
file, you'll get a Select event. When you receive the Select event
you can use the FileReference upload function to send that file to