Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

FileStream errors attempting to open file on Shared Drive

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JeffW - 15 Jul 2005 22:34 GMT
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
Bruce Barker - 16 Jul 2005 01:24 GMT
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)

> Researched this, but none of the proposed solutions are working for me.
> Am hoping for some insight.
[quoted text clipped - 27 lines]
>
> Jeff

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.