当我们浏览文件时,如何在ASP.NET中获取文件上传控件的完整路径。 [英] How to get the full path of file upload control in ASP.NET when we browse file.

查看:55
本文介绍了当我们浏览文件时,如何在ASP.NET中获取文件上传控件的完整路径。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how to get the full path of file upload control in asp.net when we browse file from any location.





我尝试了什么:



如何获得文件上传控制的完整路径在我们浏览文件时在asp.net中。



What I have tried:

how to get the full path of file upload control in asp.net when we browse file.

推荐答案

你不能。这是一个有意识的安全功能:它不会向服务器显示客户端上的环境。你得到的只是文件名:路径没有意义,因为服务器不在相同的环境中,无论如何都无法使用它。

唯一可以使用的是你要恢复的一个文件到它在客户端计算机上的原始位置 - 浏览器也不允许你这样做!
You can't. This is a deliberate security feature: it does not reveal anything about the environment on the client to the server. All you get is the file name: the path is meaningless because the server is not in the same environment and can't use it anyway.
The only time it could be of use is if you were restoring a file to it's original location on the client computer - and the browser won't let you do that either!


这篇关于当我们浏览文件时,如何在ASP.NET中获取文件上传控件的完整路径。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆