设置权限以允许ASP.net代码在服务器上创建文件夹 [英] Setting up permissions to allow ASP.net code behind to create folders on Server

查看:471
本文介绍了设置权限以允许ASP.net代码在服务器上创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.net网站,允许用户使用第三方webHTMLEditor上传图像。我创建了整个文件夹,编辑器找到它,但是当我尝试动态创建用户特定的文件夹时,它会抛出WinIOError。访问路径../common/upload/1被拒绝。

I have an ASP.net website that will allow users to upload images using a third party webHTMLEditor. I have the overall folder created and the editor finds it but when I try to dynamically create a user specific folder it throws "WinIOError. Access to the path '../common/upload/1' is denied."

我不太熟悉在服务器端设置权限和IIS,所以我希望有人可以通过如何给ASP.net代码创建../common/upload/1路径的编号文件夹部分。

I'm not very familiar with setting up permissions and IIS on the server side so I was hoping someone could run me through how to give ASP.net code behind the ability to create the numbered folder portion of the "../common/upload/1" path.

我正在使用Windows Server 2008和IIS 7。

I'm using Windows Server 2008 and IIS 7.

推荐答案

您只需要为站点运行的用户上下文设置正确的文件系统级权限。因此,如果这是对随机访问者开放的站点,则可以查看匿名用户帐户(IUSR)的设置。如果您需要用户身份验证,则需要根据所属的用户或组来设置权限。请注意,您的文件系统权限与您为网络/计算机上的用户的服务器配置文件访问权限相同。因此,这与IIS服务器的访问权限不同,所以为了确保你没有看到错误的权限,不要使用IIS管理器。

You just need to set the proper filesystem level permissions for the user context the site is running in. So if this is a site open to random visitors, you would look at the settings for your anonymous user account (IUSR). If you are requiring user authentication, then you would need to set the permissions based on the user or group(s) they belong to. Note, your filesystem permissions pertain to the same permissions as if you are configuring for file access on a server for a user on your network/machine. Thus this is not the same thing as the IIS server access permissions, so to make sure you are not looking at the wrong permissions, do not use IIS manager.

以下文章可能会帮助一些更具体的细节:
http://learn.iis.net/page.aspx/583/secure-content-in-iis-through-file-system-acls/

The following article may help with some more specific details: http://learn.iis.net/page.aspx/583/secure-content-in-iis-through-file-system-acls/

这篇关于设置权限以允许ASP.net代码在服务器上创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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