Browse for file window without uploading the file

落花浮王杯 提交于 2019-12-24 08:22:10

问题


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.)


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/10322936/browse-for-file-window-without-uploading-the-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!