asp.net FileUpload control problem: access to dire

2019-06-06 09:38发布

Im trying to use the fileupload control. Im using Visual Web Developer Express on my desktop.

My web application is working fine except I cant use the fileUpload control. I get the following error:

ERROR: Access to the path (My_Directory) is denied

I searched and it appears to be a permissions problem. So I attempted to add the user ASPNET and give appropriate permissions to the directory, however, I was unable to add user "ASPNET". User "ASPNET" was not found.

So then I followed the following directions to add user ASPNET via Control Panel > Administration > Computer management. So now I was able to add user ASPNET to the directory and give appropriate permissions but I still got the above error.

http://p2p.wrox.com/net-web-services/5918-creating-aspnet-user.html

Any ideas on why I cant access the directory?

2条回答
淡お忘
2楼-- · 2019-06-06 09:55

If you're using Vista/Windows 7/Win2003/Win2008, the user you need is the Network Service account. You can verify by seeing what user your application pool is running under.

Grant the proper permissions to that account (if indeed it's the account that your application pool is running under) and you'll be golden. Note also that with Windows 7 and Win2008, the default account could be the ApplicationPoolIdentity, which you can find out more information about at http://forums.iis.net/t/1156692.aspx. Regardless, you can simply switch the account that your application pool is running under to the Network Service account to verify that that is the issue.

查看更多
成全新的幸福
3楼-- · 2019-06-06 09:57

Ever figure this out? If you're overwriting files check to make sure they aren't set to read-only.

I've handled these permissions plenty before and had tried everything in the book and on this site and others (I'm on Win7, IIS7.5 also). Sometimes it's the silly little things...

查看更多
登录 后发表回答