IIS7和文件权限
我的虚拟目录中有一个文本文件。我的问题是,当用户在浏览器中给出该文件的 url 时,会返回其内容。我的网络应用程序正在读取和写入它,但我不想将其显示给用户。如何设置此文件的权限或配置 IIS7 来实现此任务?
I have a text file in my virtual directory. My problem is that when a user gives the url for this file in a browser, its contents are returned. My web application is reading from and writing to it but I don't want to show it to user. How to set permissions of this file or configure IIS7 to achieve this task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将文件从网站文件夹移至 c:\datafiles 等位置。授予 IIS 帐户对其的读/写访问权限,然后 Web 用户就无法获取它。
编辑:
或者您可以将扩展名更改为 IIS 不会切断的扩展名,例如 .config
You can move the file out of your web site folder into a place like c:\datafiles. Give the IIS account read/write access to it and then there is no way a web user can get it.
EDIT:
Or you could change the extension to something that is not severed by IIS like .config
您还可以删除 IUSER 帐户的读取权限。为了提高安全性,请保留 ASPNET 机器和系统的读写权限。
Also you can Remove the Read permission from IUSER account. for more security keep read and write permission for ASPNET MACHINE and SYSTEM.