如何限制在asp.net文件夹的访问 [英] How to restrict folder access in asp.net

查看:143
本文介绍了如何限制在asp.net文件夹的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制在asp.net文件夹的访问
像我逼债需要的任何其他通过链接 http://www.example.com/Uplo​​ads

请帮忙


解决方案

有关下一代这对我的作品的答案是使用隐藏段。

如果你想获得如的上传的文件夹去你的根Web.config并添加到< system.webServer> 以下元素:

 <安全>
  <&的requestFiltering GT;
    < hiddenSegments>
      <添加段=上传/>
    < / hiddenSegments>
  < /&的requestFiltering GT;
< /安全>

这将prevent直接访问所有用户的上传的文件夹及其内容。

How to restrict folder access in asp.net like i dun want any other to see my Uploads folder in browser by link http://www.example.com/Uploads

Please help

解决方案

For the future generation the answer which works for me is to use hidden segments.

If you want to secure e.g. Uploads folder go to your root Web.config and add into <system.webServer> following element:

<security>
  <requestFiltering>
    <hiddenSegments>
      <add segment="Uploads"/>
    </hiddenSegments>
  </requestFiltering>
</security>

This will prevent all users from direct access to Uploads folder and its content.

这篇关于如何限制在asp.net文件夹的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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