views:

691

answers:

3

Hi,

I have a ASP.NET/C# web application with FLASH object integrated. I need to upload two image files to the server at once from one HTTP POST via file reference class in FLASH. Is it possible? If so, How to do it ?

Thanks.

+1  A: 

The FileReferenceList class has browse() method that lets you choose multiple files to upload. You can then loop through the fileList property and use the upload() method to upload each FileReference objects. You could also use a JavaScript/Flash library such as YUI Uploader or SWFUpload to manage file uploads. It might actually be easier than building your own Flash uploader.

YUI Uploader - http://developer.yahoo.com/yui/uploader/

louisroy
I did have a look at the SWFUpload but my problem is, even though we can keep multiple references in FileReferenceList class we need to upload them one by one. This would make multiple requests to the server. My requirement is to upload two files at once by a single request as the processing of both images has to be done at once.
Dimuthu
+2  A: 

I wrote a blog on this issue at the start of the year which may help:

http://blog.mikestead.me/upload-multiple-files-with-a-single-request-in-flash/

Or if you just want to jump to the code solution you can find it here:

http://github.com/mikestead/as3urlrequestbuilder

Mike Stead
A: 

Thanks Mike. Your solution is so much perfect!

Wesley Wu