This content has been marked as final. Show 4 replies
There are 2 types of objects in Flex for uploading files. The FileReference ( used to upload a single object) and the FileReferenceList object for uploading multiple objects. Take a look at the example of how the FileReferenceList accomplishes its task.
It amounts to uploading one file at a time and utilizing the callback methods to begin the next upload. Your server object should only handle one file at a time.
Go here and look at the FileReferenceList example
I have looked at the example on the link you gave. According to the example for the FileReferenceList in the documentation, it seems to make multiple or rather separated requests to the server-side upload script.
So for example if I have 3 files to upload, the script will call the the upload() function of the FileReference class thrice with the URLRequest(which is the server-side upload script). So in this case, my server-side script that is handling the upload will only upload one file at one time.
Is there a way where I can have say all the 3 files sent together to the server-side script, and then have them uploaded all at once within the server-side script itself?
So say my PHP file, I could have access to like $_FILES['Filedata1'], $_FILES['Filedata2'] and $_FILES['Filedata3'] together at one request.
Flex objects will only allow one file to be uploaded at a time. here is a quote from the Flex API for the upload method of the FileReference object.
"Listeners receive events to indicate the progress, success, or failure of the upload. Although you can use the FileReferenceList object to let users select multiple files for upload, you must upload the files one by one; to do so, iterate through the FileReferenceList.fileList array of FileReference objects."
So the answer is no. You need to upload each file one at a time.
aww...Still, thanks mhartnett for that. :)