Most of the solutions here don't work.
I am trying to upload a file, an image, to a folder in the server called images, when i click the button to upload it, after it passes ImageUpload.SaveAs(Path)
i get an exception "Access to Path "any path here" is denied, now i tried editing the security tab of the folder and gave permission to NETWORK SERVICE
, i tried giving permission to IIS AppPool\\DefaultAppPool
, still not working. i also enabled ASP.NET Impersonation in the iis manager as some other people said, still same error.
The default Identity the applicationpool runs in, is the ApplicationPoolIdentity
, not the NETWORK SERVICE
account.
You could assign modify rights on the folder to the ApplicationPoolIdentity (look here ), or you can change the identity of the application pool to a different user with permissions on the uploads folder.
Do take care when you run the applicationpool with a different user: make sure not to give that user more rights than in absolutely needs.
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.