Is there a way to set the value of a file input (<input type="file" />
) or is that all blocked for security? I'm trying to use google gears' openFiles to make a simple multi-uploader.
Note:
The answer(s) below reflect the state of legacy browsers in 2009. Now you can actually set the value of the file input element dynamically/programatically using JavaScript in 2017.
See the answer in this question for details as well as a demo:
How to set file input value programatically (i.e.: when drag-dropping files)?