This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Would be good to be able to do some or all of the following: input.files = [blob1, file1, blob2, blob3, file2]; input.files.empty(); input.files.append(blob1); input.files.append(file1); Maybe by making HTMLInputElement.files return an object that inherits from FileList and extends it, and by having input.files have some sort of PutForwards- like magic that takes an array.
Also desired (ack Nico Weber): input.files = dataTransfer.files; ...to copy the files from a drag-and-drop operation onto an <input> element for submission. But I don't think we should actually set the FileList object itself; seems dangerous to have the object identity change... cc'ing Boris who may have relevant opinions on API design around this.
Space here may be constrained by implementations: https://bugs.webkit.org/show_bug.cgi?id=87154 https://bugzilla.mozilla.org/show_bug.cgi?id=757664
In the thread starting http://lists.w3.org/Archives/Public/public-script-coord/2013AprJun/0153.html most people felt that having setters and getters that return different types, and generally setters that do various magic things to what's being set, is pretty odd API... I don't know that I have a strong opinion myself, yet.
So WebKit now does comment 1, with the object changing identity. Nothing in comment 0 has been implemented so far by anyone as far as I can tell.
When you say "changing identity" do you mean that after I do: input.files = dataTransfer.files; then input.files === dataTransfer.files tests true? Or that it test false?
It tests true.
Spec-wise, I'm not sure how to proceed. I need two implementors intending on converging on the same thing or willing to implement the same proposal before I can update the spec. Moving back to "Needs Impl Interest" for now.
Please file a new issue at https://github.com/whatwg/html/issues/new if this is still desired.
(In reply to Anne from comment #8) > Please file a new issue at https://github.com/whatwg/html/issues/new if this > is still desired. Filed: https://github.com/whatwg/html/issues/2861