Javascript Intercepted “Ctrl+O” Does Not Open My File Dialog

后端 未结 4 1569
粉色の甜心
粉色の甜心 2021-01-18 05:12

I have an file-browser input in my HTML.

I have another button with ID choose-file-button

4条回答
  •  渐次进展
    2021-01-18 05:33

    You cannot do that in all browsers, as far as I am concern only IE allow it. I guess this is due to security issues, so that programmer are disabled to set the file name on the HTML File element automatically(without permission of client).

    have a look on this link for more details:

    In JavaScript can I make a "click" event fire programmatically for a file input element?

    Show input file dialog on load?

提交回复
热议问题