W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2014

[Bug 26302] New: Please add a FileList constructor

From: <bugzilla@jessica.w3.org>
Date: Thu, 10 Jul 2014 00:31:02 +0000
To: public-webapps@w3.org
Message-ID: <bug-26302-2927@http.www.w3.org/Bugs/Public/>

            Bug ID: 26302
           Summary: Please add a FileList constructor
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: File API
          Assignee: arun@mozilla.com
          Reporter: costan@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: public-webapps@w3.org

Please consider adding a FileList constructor. I think it should take a
sequence<File> argument, for consistency with the File constructor.

Motivation: when combined with the File constructor and with a read-write
"files" property on the HTMLInputElement (see Bug 17125), this is sufficient to
implement any changes to the list of files that an <input type="file"> would
upload. For example, Bug 17125 can be implemented by creating a new FileList
that contains all the Files in the old list, except for the one that should be

Security implications: there shouldn't be any, as it already is possible to
create a FileList in a round-about way, by adding File instances to a
DataTransfer [1] via items.add(File) and reading the files attribute. This is
already used in the wild [2]. Also, this proposal leaves FileList immutable,
which might simplify some correctness / security analysis.

Alternatives: Bug 24586 proposes removing FileList altogether, but it relies on
Bug 23682, which requires significant changes and thinking. The approach
suggested here can be implemented now. If the JS array succeeds, the FileList
constructor can be deprecated at the same time as the items() method.

Thank you!

[2] http://crbug.com/360308

You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 10 July 2014 00:31:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:26 UTC