Directory Chooser in HTML page

后端 未结 5 581
南旧
南旧 2020-11-22 11:23

How can I create a directory chooser in html page.
If I use input file element I can select file only, but I need to select directory instead.
I need to do this beac

5条回答
  •  一生所求
    2020-11-22 11:54

    I did a work around. I had a hidden textbox to hold the value. Then, on form_onsubmit, I copied the path value, less the file name to the hidden folder. Then, set the fileInput box to "". That way, no file is uploaded. I don't recall the event of the fileUpload control. Maybe onchange. It's been a while. If there's a value, I parse off the file name and put the folder back to the box. Of, course you'd validate that the file as a valid file. This would give you the clients workstation folder.
    However, if you want to reflect server paths, that requires a whole different coding approach.

提交回复
热议问题