Windows4.0、Visual Studio2010、asp.net 7、ASP.NET开发服务器、FileUpload控件
我已经和这个问题斗争了一整天。我已经授予每个人对该目录的完全控制权限。
我有一个FileUpload控件,当代码尝试SaveAs()时,它抛出System.UnauthorizedAccessException,我得到错误:
{"Access to the path 'D:\FileAttachments\17' is denied."}
_HResult = &H80070005
Source = "mscorlib"
StackTrace = "at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at System.Web.UI.WebControls.FileUpload.SaveAs(String filename) ..."
我把目录从网站下面移了出来
我已将完全控制权授予每个人,包括我、网络服务、经过身份验证的用户、系统、管理员、用户、IIS_IUSRS、
我已经运行attrib来删除只读访问权限
我已经添加到web.config中
我已经将应用程序池标识更改为网络服务-但我不确定这会有什么作用,因为我认为VS2010使用了自己的开发服务器。
WindowsIdentity.GetCurrent返回
IdentifierAuthority = NTAuthority {&H5}
AuthenticationType = "NTLM"
Name = "mymachine\myname"
但在我尝试添加权限的windows资源管理器中,它无法识别名为"NTAuthority“的用户。
有什么想法吗?谢谢
(很抱歉这种时髦的格式- stackoverflow不允许我发布问题,因为它认为我有代码没有标记为代码)
发布于 2011-09-15 15:25:20
该死的。问题实际上是一个错误的文件名。不确定为什么它会抛出安全/权限错误,而问题是错误的文件名。
https://stackoverflow.com/questions/7423560
复制相似问题