在web.config中保护的路径/文件夹 [英] Secured path/folder in web.config

查看:150
本文介绍了在web.config中保护的路径/文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的web应用程序创建一个安全的路径。

I created a secure path in in my web-application.

喜欢在这个环节提到: http://msdn.microsoft.com/ EN-US /库/ ff648341.aspx

like mention in this link : http://msdn.microsoft.com/en-us/library/ff648341.aspx

当我使用下面的配置对于安全我的文件:

when i use the below config for secure my files:

<location path="Secure">
    <system.web>
      <customErrors mode="RemoteOnly" redirectMode="ResponseRewrite" defaultRedirect="error.html">
      </customErrors>
      <authorization>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>

下面的文件都没有loign accessable:

the below files are not accessable without loign:

my host link /secure/xyz/01.doc    
my host link /secure/xyz/01.docx    
my host link /secure/xyz/01.xls    
my host link /secure/xyz/01.xlsx

但下面的文件仍然没有accessable登录:

but the below files are still accessable without login:

my host link /secure/xyz/01.pdf    
my host link /secure/xyz/01.txt    
my host link /secure/xyz/01.png


这样一个行为的任何想法?
为什么除了办公文档文件仍然accessable?
我需要将其固定。


any idea about such a behaviour? why other than office document files are still accessable? i need to secure them.

推荐答案

得到了解决。

登录后,当点击下载上有甲.PDF巴纽的.txt文件,
结果浏览器下载剪掉 - 但它在同一标签结果显示
(和浏览器缓存的话,我想是这样......如果我错了请纠正我!)结果
以.doc .xls的情况下,它打开对话框下载(无缓存)。

After login, when click to download on the file having formate .pdf .png .txt,
Browser didnt download - but it shown in the same tab
(and browser cached it, i think so... Correct me if i Wrong!!!)
in case of .doc .xls it open the dialog to download (without caching).

注销后,在浏览的.PDF巴纽.TXT结果的下载链接
它打开它/从缓存中加载它。结果
在另一方面,虽然冲浪的.doc .xls的重定向我登录搜索

After Logout, on browsing the download link of .pdf .png .txt
It opens it / load it from cache.
on the other hand, while surfing .doc .xls redirect me to login

这篇关于在web.config中保护的路径/文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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