设置权限以允许 ASP.net 代码隐藏在服务器上创建文件夹
我有一个 ASP.net 网站,允许用户使用第三方 webHTMLEditor 上传图像。我创建了整个文件夹,编辑器找到了它,但是当我尝试动态创建用户特定的文件夹时,它会抛出“WinIOError。访问路径‘../common/upload/1’被拒绝”。
我不太熟悉在服务器端设置权限和 IIS,所以我希望有人可以指导我如何让 ASP.net 代码能够创建“../common/upload”的编号文件夹部分/1”路径。
我使用的是 Windows Server 2008 和 IIS 7。
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."
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.
I'm using Windows Server 2008 and IIS 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需为站点运行所在的用户上下文设置适当的文件系统级别权限。因此,如果这是一个向随机访问者开放的站点,您将查看匿名用户帐户 (IUSR) 的设置。如果您需要用户身份验证,则需要根据用户所属的用户或组设置权限。请注意,您的文件系统权限与您为网络/计算机上的用户配置服务器上的文件访问权限相同。因此,这与 IIS 服务器访问权限不同,因此为了确保您没有查看错误的权限,请不要使用 IIS 管理器。
以下文章可能有助于了解一些更具体的细节:
http://learn. iis.net/page.aspx/583/secure-content-in-iis-through-file-system-acls/
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.
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/