Click here to Skip to main content
11,411,241 members (64,170 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,

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
Ashok26359

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
Ashok26 at 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 at 4-Feb-13 7:47am
   
So, is impersonate set to false in your web.config?
Ashok26 at 24-May-13 6:24am
   
Yes.
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 at 24-May-13 8:21am
   
What identity is your app pool using?
Ashok26 at 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 at 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
0 Sergey Alexandrovich Kryukov 189
1 Maciej Los 98
2 OriginalGriff 88
3 Sascha Lefévre 85
4 BillWoodruff 80
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 6,983
2 Maciej Los 3,430
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150414.5 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
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