Button to show choose a file to upload dialog box

后端 未结 5 1963
粉色の甜心
粉色の甜心 2021-02-09 16:22

Instead of using an input type=\"file\" html tag, is it possible to bring up a choose a file to upload dialog box by clicking a input type=\"but

5条回答
  •  时光说笑
    2021-02-09 17:05

    I think most browsers have this locked down for security purposes. Buttons and text boxes can be manipulated via JavaScript. File input boxes cannot, and for good reason; imagine if a javascript could open a dialog, set the path to a sensitive file on your system, then simulate the button click to download the file!


    By the way, if you are looking to style it, perhaps this would work: http://www.quirksmode.org/dom/inputfile.html

提交回复
热议问题