Could not find a part of the

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Make sure the user account used to run asp.net has access rights to this
location.
 
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
 
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
 
Back
Top