Re: FileStream errors attempting to open file on Shared Drive



the network service account is a local account, and thus does not have
network permissions. you will have to impersonate a domain account.

-- bruce (sqlwork.com)


"JeffW" <jwilson@xxxxxxxxxxxx> wrote in message
news:1121463252.506147.276790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Researched this, but none of the proposed solutions are working for me.
> Am hoping for some insight.
>
> Am trying to open a binary file that exists on a shared drive for
> reading. Code lives inside a .NET web app and looks like this:
>
> FileStream fs = new FileStream(_documentInfo.DocFile, FileMode.Open,
> FileAccess.Read);
>
> This statement generates error:
>
> Could not find a part of the path "T:\TN001068\TN001068_Jun2005.PDF"
>
> Details: System.IO.DirectoryNotFoundException
>
> Based on my research, I understand it's a permissions problem. Since
> this is a .NET app, the shared drive must be set up to allow access by
> the ASP.NET "user". I access the shared drive's properties and under
> security, add "ASPNET" user with permission to read and list folder
> contents. Same error.
>
> Other research showed me how to use WindowsIdentity.GetCurrent() inside
> the app to see what user is in effect when running the app. It tells
> me "NT_AUTHORITY/NETWORK SERVICE". I go the shared drive's properties
> and set the same permissions for user "NETWORK SERVICE". Same error.
>
> Is there something in IIS that needs to be set?
>
> Any assistance would be eternally appreciated.
>
> Jeff
>


.



Relevant Pages