Could not find a part of the

G

Guest

While trying to create new File, i recieve the following error=
message: "System.IO.DirectoryNotFoundException: Could not find a part of the =
path=20 "Y:\Reports.pdf ". The Y: is shared folder of another system and it
maped to the local system. The path exists.
 
E

Eliyahu Goldin

Make sure the user account used to run asp.net has access rights to this
location.
 
H

Hans Kesting

While trying to create new File, i recieve the following error=
message: "System.IO.DirectoryNotFoundException: Could not find a part of the
= path=20 "Y:\Reports.pdf ". The Y: is shared folder of another system and it
maped to the local system. The path exists.

The Y: mapping is for *your* account, which is not the account the
website runs under. Moreover, this ASPNET account is a local account
with limited priviledges. It can not access the network for example.
You might need to van the site impersonate some domain-user that *can*
access that share *and* use the UNC path (\\server\share) to access it.

Hans Kesting
 
T

T.Jeywin Lizy

Please let me know how should this be done :
impersonate some domain-user that *can*
access that share *and* use the UNC path (\\server\share) to access it.

My problem:
When trying to read the file the user selects in PDA it gives an error
message
DirectoryNotFoundException:could not find a part of the path.(The same code
works fine in my system and diff remote servers)

My Code:

Stream a = ReadStream(txtFilePath.Text);
Label1.Text = a.Length.ToString();
_______________________

using System.Security.Permissions;
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name =
"FullTrust")]
namespace FileBus
{

public Stream ReadStream(string pathSource)
{
FileStream f = new FileStream(pathSource, FileMode.Open,
FileAccess.Read);
Stream a = (Stream)f;
return a;
}
}

Please help.
T.Jeywin Lizy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top