简体   繁体   中英

Access to path is denied on server

I'm trying to make a multiple file upload function (last example from http://msdn.microsoft.com/en-us/library/aa478971.aspx )

I changed the upload location to

"httpContext.Current.Server.MapPath("~/images/")

and when I upload a file, it says

Access to the path "D:...." is denied.

I cant set permission for the folder on the server for some reason. what else can I do?

All help appreciated. Thanks!

Your asp.net account {MACHINE}\\ASPNET does not have write access to that location. That is the reason why its failing.

Consider granting access rights to the resource to the ASP.NET request identity.

-Right click on downloading folder Properties > Security Tab > Edit > Add > locations > choose your local machine > click OK > Type ASPNET below "Enter the object name to select" > Click Check Names Check the boxes for the desired access (Full Control). If it will not wok for you do the same with Network Service Properties > Security Tab > Edit > Add > locations > choose your local machine > click OK > Type ASPNET below "Enter the object name to select" > Click Check Names Check the boxes for the desired access (Full Control). If it will not wok for you do the same with Network Service .

Now this should show your local {MACHINENAME}\\ASPNET account, then you set the write permission to this account.

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