How can I have a preselected input for when type=“file”? [duplicate]
问题 This question already has answers here : How to set file input value when dropping file on page? [duplicate] (1 answer) Putting default value in <input type=file…> (1 answer) Closed 6 years ago . Note: 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 in 2017. See the answer in this question for details as well as a demo: How to set file input value