Browse for file window without uploading the file

2019-08-07 07:52发布

Is there a way to get the select file dialog box open and putting the location of the file into a textbox without ever uploading the file?

ETA I'm using VB.NET in a web page. By using the asp:fileupload tag I can get the file location

_fudFileLocation.PostedFile.FileName_

But how do I prevent the file from being uploaded at all. We don't need it, just the file location. (The files are on a shared drive so if it's M:\documents\todayslunch.pdf for person A, it's the same for person B.)

2条回答
我想做一个坏孩纸
2楼-- · 2019-08-07 08:01

You do not get access to the full filepath in the browser because of security.

If this was possible, one could get the full layout of the computer of anyone going to any website.

查看更多
萌系小妹纸
3楼-- · 2019-08-07 08:09

System.Web.HttpPostedFile.FileName gets the fully qualified name of the file on the client which includes the directory path.

查看更多
登录 后发表回答