当前位置: 动力学知识库 > 问答 > 编程问答 >

actionscript - 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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: