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

混江龙づ霸主 提交于 2020-01-07 06:32:44

问题


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.


回答1:


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/



来源:https://stackoverflow.com/questions/7653606/setting-up-permissions-to-allow-asp-net-code-behind-to-create-folders-on-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!