<blockquote>
<p><strong>Note:</strong></p>
<p>The answers & comments 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 and a dataTransfer or FileList object in 2017.</p>
<p>See the answer in this question for details as well as a demo:<br/><a href="https://stackoverflow.com/q/47515232/584192">How to set file input value programatically (i.e.: when drag-dropping files)?</a></p>
</blockquote>
<p>如何设置此值?</p>
<pre><code><input type="file" />
</code></pre>