Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
568 views
in Technique[技术] by (71.8m points)

iis 7 - 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. 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...