vb.net 事件代码:4011 尝试使用处理程序上传文件时发生未处理的访问异常

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25122473/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 17:57:41  来源:igfitidea点击:

Event code: 4011 An unhandled access exception has occurred while trying to upload files using a Handler

asp.netvb.netiis-7.5windows-authentication

提问by Dobin

We have an website site with a module to upload files to a network drive.

我们有一个带有将文件上传到网络驱动器的模块的网站。

The problem is that the upload handler works when accessed internally and uploads the file to required network drive, but fails with a 4011 Event Id When accessed from outside the network. Can you help on what we are doing wrong

问题是上传处理程序在内部访问时工作并将文件上传到所需的网络驱动器,但在从网络外部访问时失败并显示 4011 事件 ID。你能帮忙解决我们做错了什么吗

DETAILS
?The site is running on Windows Server 2008 R2 Standard 64 bit, IIS 7.5
?The site has impersonation true and we are using a domain user with full access on server and also on the network folder where the files will be uploaded via the handler
?The Code to Impersonate the domain user happens in the handler and works as expected within the network

详细信息
?该站点在 Windows Server 2008 R2 标准 64 位、IIS 7.5 上运行
?该站点具有模拟真实性,我们正在使用具有服务器和网络文件夹完全访问权限的域用户,并且文件将通过处理程序上传到网络文件夹
? 模拟域用户的代码发生在处理程序中,并在网络内按预期工作

Below are the log details

以下是日志详情

Event code: 4011 
Event message: An unhandled access exception has occurred. 
Event time: 8/4/2014 12:04:03 PM 
Event time (UTC): 8/4/2014 9:04:03 AM 
Event ID: 5124ff6156ff47728c544cfb70c488f2 
Event sequence: 628 
Event occurrence: 2 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/sitefolder-4-130516162183314587 
    Trust level: Full 
    Application Virtual Path: /sitefolder
    Application Path: C:\inetpub\wwwroot\sitefolder\ 
    Machine name: XXX

Process information: 
    Process ID: 2520 
    Process name: w3wp.exe 
    Account name: domain\username

Request information: 
    Request URL: https://sitenamex:443/sitefolder/DOP/FileUploadHndler.ashx?type=rau 
    Request path: /sitefolder/DOP/FileUploadHndler.ashx 
    User host address: 98.98.0.88 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: domain\username

Any help would be greatly appreciated

任何帮助将不胜感激

回答by Rose

You mention that files are uploaded to a network drive. If that network drive drive does not have the proper network permissions it can cause the error you mention '4011'

您提到文件已上传到网络驱动器。如果该网络驱动器没有适当的网络权限,则可能会导致您提到的错误“4011”