Click here to Skip to main content
12,824,787 members (42,567 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET

We have a file placed at a shared location.
PLanning to use it from a .NET page to read contents.

Can we provide permissions to NETWORK SERVICE so that the file is accessible from .NET.

I added NETWORK SERVICE as a user on the shared folder but not able to access.

The file is accessible when I impersonate my ID in Web.Config.
But certainly I cannot use my id for Production environment.
Posted 30-Jan-13 10:50am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to find out what account the Application Pool is set to run as. In IIS, find the app pool your site is in and find the account that is running it. That is the account that needs the permissions.
Ashok26 3-Feb-13 18:52pm
Just to make sure I checked it again. App pool is using identity NETWORK SERVICE and I have given NETWORK SERVICE the permissions on the shared folder. Still Access is denied.
ryanb31 4-Feb-13 7:47am
So, is impersonate set to false in your web.config?
Ashok26 24-May-13 6:24am
I do not impersonate. I had even tried to add user with server name and aspnet.

Now, I got to know there is a special format to add $ at end. Need to try that.
ryanb31 24-May-13 8:21am
What identity is your app pool using?
Ashok26 22-Jul-13 19:22pm
This is what I tried:
Creating a user account and providing permissions on shared drive
Impersonate using this account. In order to make it work, I had to provide few permissions on folders on web server.
It works but there is an issue: After first download, next downloads start failing with an error of "Connection with the server was reset". It allows the complete file to be downloaded to client before the error. I think the file is not getting copied finally from temporary location to the client's selected location.
ryanb31 22-Jul-13 20:52pm
I don't know for sure but this error can sometimes be ignored. If it is downloading properly you should be fine. It depends on the code you are using. If you are modifying the Response object then yes, this error could be OK.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100