开发者

Fileupload Control in asp.net

开发者 https://www.devze.com 2023-01-05 05:53 出处:网络
I want to get full path which user selected in file upload control开发者_JS百科. how can we do it. You can\'t.

I want to get full path which user selected in file upload control开发者_JS百科. how can we do it.


You can't.

The file upload will send you the file, with the filename, but nothing else. Giving you the full path on the users computer is both a possible invasion of privacy and a possible security breach, so it is not allowed.


I don't think you can do that for security reasons. This means you can get information about any user folder structure that uploads files to your web site.

Regards...


browser restrictions does not allow this, however there are some hints using javascript before submiting to achieve this

For instance

<asp:button onClientClick="document.getElementById('hiddenField1').value = document.getElementById('fileUpload1').value"  ... 

Then the path can be retrieved on server side via hiddenField1.Value

0

精彩评论

暂无评论...
验证码 换一张
取 消