[whatwg] Make files attribute of the input element writable

Nico Weber thakis at chromium.org
Tue May 22 10:41:34 PDT 2012


Hi,

The files attribute of the input element is currently marked readonly
[1], to protect from `myInput.files = "/etc/passwd"; myForm.submit()`.
Since its type is now FileList and not string, that's no longer
necessary.

Making the attribute writable would allow setting the files property
of an input element to dataTransfer.files from a drop handler. For
example, I would like to use this to create a larger drop-target for a
file input. Here's one request for this functionality:
http://stackoverflow.com/questions/8006715/drag-drop-files-into-standard-html-file-input

Can the readonly restriction be removed from the spec?

Nico


1: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-element


More information about the whatwg mailing list