简体   繁体   English

设置权限以允许背后的ASP.net代码在服务器上创建文件夹

[英]Setting up permissions to allow ASP.net code behind to create folders on Server

I have an ASP.net website that will allow users to upload images using a third party webHTMLEditor. 我有一个ASP.net网站,该网站将允许用户使用第三方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." 我已经创建了整个文件夹,编辑器找到了它,但是当我尝试动态创建用户特定的文件夹时,它会抛出“ WinIOError。对路径'../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. 我对在服务器端设置权限和IIS不太熟悉,所以我希望有人可以帮助我解决如何在ASP.net代码后面创建“ ../common/upload”的编号文件夹部分的功能。 / 1“路径。

I'm using Windows Server 2008 and IIS 7. 我正在使用Windows Server 2008和IIS 7。

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). 您只需要为运行该网站的用户上下文设置适当的文件系统级别权限。因此,如果这是一个对随机访问者开放的网站,则需要查看您的匿名用户帐户(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. 因此,这与IIS服务器访问权限不同,因此,请确保不要使用错误的权限,请不要使用IIS管理器。

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/ 以下文章可能会帮助您提供一些更具体的细节: http : //learn.iis.net/page.aspx/583/secure-content-in-iis-through-file-system-acls/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM