简体   繁体   中英

How do I configure a upload folder in IIS6 and asp.net? win server 2003 sp2

I have an internal asp.net app that uses the fileupload control to put data files in a "drop" folder. I would like to lock down this folder so only users that are part of a local group can actually authenticate and upload the file. I have created a group on the server, added the domain users to the local group. I have then given that group write access to the "drop" directory.

When I try to upload a file to the directory I get the expected login screeen but my login doesn't work and after several tries the page errors out with " Access to path '\\server\\path\\fubar\\drop folder name\\filename.txt" is denied "

How do I set it up so that each user has to login but the login actually works? TIA J

You are experiencing a permission issue.

1) You need to set up impersonation on the IIS webserver ( http://msdn.microsoft.com/en-us/library/134ec8tc.aspx ). This will allow the network credentials to be passed through from any internet explorer browser to the web server.

2) You then need to right click on the upload folder and then go to 'properties' --> 'security' --> 'edit' --> 'add' --> type in the name of the users/groups --> click ok --> select correct privaliges (Read and Modify).

NOTE: if you are operating a an internal web application you dont need the user to log in. Thats the whole point of impersonation. No point in makign people log in if they have authenticated on the network already.

If you must make them log in over the top then you need to validate them against your AD server and then change the user that the page is operting under programatically like this:

protected void Page_Load(object sender, EventArgs e)
    {
        this.User.Identity = new NetworkCredential("username", "password");
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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