Search code examples
asp.netvb.netiis-7.5windows-authentication

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


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

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

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


Solution

  • 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'