Alex Polo
Alex Polo

Reputation: 905

Uploading multiple files via Flash

As known, each subsequent time that the FileReferenceList.browse() method is called, the FileReferenceList.fileList property is reset to the file(s) that the user selects in the dialog box. And my question is:

How to manage to "remember" all previously selected files, each subsequent time that the FileReferenceList.browse() method is called? so that to append new ones and upload them all later on.

Upvotes: 1

Views: 131

Answers (1)

Justin Ohms
Justin Ohms

Reputation: 3523

The file reference list is just a collection of file references. The file references are what you need in order to upload each file. (You don't need the FileReferenceList) You can simply copy all of the items to another collection.

If you are feeling adventurous and want to do it in an OO way you might try this:

  • Create your own "AppendableFileReferenceList" which would extend FileReferenceList
  • Every time a FileRefence list is created (i.e. .browse() is called ), the list returned is copied and appended to a separate collection in your object.
  • You then have complete control over that collection. (clearing it when you need etc.)

Depending on your needs you might even make that class take care of your uploading as well.

Upvotes: 1

Related Questions