473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FileStream errors attempting to open file on Shared Drive

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

Nov 19 '05 #1
1 3141
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" <jw*****@telnetww.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martyn Wynne | last post by:
Hi, Can anyone please tell me if there is any reason why when i am streaming from a webrequest (decompressing on route) to a file on the hard drive, i would be getting an exception of Filestream...
0
by: JeffW | last post by:
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...
0
by: Martyn Wynne | last post by:
Hi, Can anyone please tell me if there is any reason why when i am streaming from a webrequest (decompressing on route) to a file on the hard drive, i would be getting an exception of Filestream...
7
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.