加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 拒绝直接访问文件夹(仅允许通过应用程序)

发布时间:2020-12-16 00:17:16 所属栏目:asp.Net 来源:网络整理
导读:我需要阻止某人直接访问pdf,而只是允许他们通过应用程序本身.如何才能做到这一点? 解决方法 查看我的博客文章: How to hide users files and folders on your website? There are two solutions for doing that: 1- You can put your “UsersUploads” fol
我需要阻止某人直接访问pdf,而只是允许他们通过应用程序本身.如何才能做到这一点?

解决方法

查看我的博客文章:
How to hide users files and folders on your website?

There are two solutions for doing that:

1- You can put your “UsersUploads” folder outside the website
directory,so if your website exist on “c:websiteexample.com” you
can put the “UsersUploads” there “c:UsersUploads”,Like that IIS has
no control over this folder and its files,And your website code will
still have access to this directory as a normal physical path.

2- Stop IIS from serving this folder:

IIS by default doesn’t server some website folders and files such App_Data,App_Code,bin,App_GlobalResourses,App_LocalResources,Web.config,….

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读