In JavaScript is it possible to launch a file browser dialog programmatically?

前端 未结 5 1558
耶瑟儿~
耶瑟儿~ 2020-12-15 23:18

Instead of using the tag I\'d like to have a button that launches a file browser dialog.

My first thought was to have a hidd

5条回答
  •  鱼传尺愫
    2020-12-16 00:01

    You can do it without any security issues. Just code that on onmouseenter will promote the zindex of the real upload button (you can use opacity on it or make it transparent) and then you will not need to trigger a click but just use the click from the user.

提交回复
热议问题