By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

From ASPX page, can't access file on another PC on network

P: n/a
In my .aspx page, I am trying to read file that is on a different on the
company network.

When I map a drive to it and call from within my .aspx page, I get this
error:

Could not find a part of the path 'Z:\Events.nss'.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path 'Z:\Events.nss'.

When I put in the path as \\server\content\Events.nss, I get an error saying
I needed a username and password to be able to get to that place.

How can I get to this file?

Thanks for any help,

Ron
Mar 17 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Thu, 16 Mar 2006 16:59:32 -0700, "Ronald S. Cook" <rc***@westinis.com> wrote:
In my .aspx page, I am trying to read file that is on a different on the
company network.

When I map a drive to it and call from within my .aspx page, I get this
error:

Could not find a part of the path 'Z:\Events.nss'.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path 'Z:\Events.nss'.

When I put in the path as \\server\content\Events.nss, I get an error saying
I needed a username and password to be able to get to that place.

How can I get to this file?

Thanks for any help,

Ron

That typically means you don't have permission to read that file. See your
system administrator.

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Mar 17 '06 #2

P: n/a
The ASPNET user in your computer didn't have the permission to access file
on the remote computer.
The remote computer has to grant your ASPNET account to access that file.

"Ronald S. Cook" <rc***@westinis.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...
In my .aspx page, I am trying to read file that is on a different on the
company network.

When I map a drive to it and call from within my .aspx page, I get this
error:

Could not find a part of the path 'Z:\Events.nss'.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path 'Z:\Events.nss'.

When I put in the path as \\server\content\Events.nss, I get an error
saying I needed a username and password to be able to get to that place.

How can I get to this file?

Thanks for any help,

Ron

Mar 17 '06 #3

P: n/a

"Dragon" <ta*****@hotmail.com> wrote in message
news:OH**************@tk2msftngp13.phx.gbl...
| The ASPNET user in your computer didn't have the permission to access file
| on the remote computer.
| The remote computer has to grant your ASPNET account to access that file.
|

Which is not possible as ASPNET is a local account.

Willy.
Mar 17 '06 #4

P: n/a
Your mapped drive Z: is mapped in the context of the "interactive user"
session, not in the context of the ASPNET user or whatever user context your
Web application runs in.
You have to impersonate a user account that has the appropriate access
privileges to the remote share, and you should use UNC paths to access
remote files.
There are several way's to accomplish this, but the most appropriate is
through a COM+ server type component.

ASP.NET -----> COM+ server ------> Remote share
local user domain user/network user

Here you keep your asp.net application running as a local user, while your
COM+ application runs as a domain user or as a user (f.i a shadow account)
with appropriate access privs. to the remote share.
Willy.

"Ronald S. Cook" <rc***@westinis.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...
| In my .aspx page, I am trying to read file that is on a different on the
| company network.
|
|
|
| When I map a drive to it and call from within my .aspx page, I get this
| error:
|
|
|
| Could not find a part of the path 'Z:\Events.nss'.
|
| Description: An unhandled exception occurred during the execution of the
| current web request. Please review the stack trace for more information
| about the error and where it originated in the code.
|
| Exception Details: System.IO.DirectoryNotFoundException: Could not find a
| part of the path 'Z:\Events.nss'.
|
|
|
| When I put in the path as \\server\content\Events.nss, I get an error
saying
| I needed a username and password to be able to get to that place.
|
|
|
| How can I get to this file?
|
|
|
| Thanks for any help,
|
| Ron
|
|
Mar 17 '06 #5

P: n/a
Yes, right, How about if two computer in the same domain ?
Can it be granted ? I am not sure...

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

"Dragon" <ta*****@hotmail.com> wrote in message
news:OH**************@tk2msftngp13.phx.gbl...
| The ASPNET user in your computer didn't have the permission to access
file
| on the remote computer.
| The remote computer has to grant your ASPNET account to access that
file.
|

Which is not possible as ASPNET is a local account.

Willy.

Mar 17 '06 #6

P: n/a
What do you mean with "Can it be granted ?". A local account doesn't have
network access privileges at all. When running in a domain, you can
impersonate or run your web application as a domain user, but the latter is
something you should only do in a 'secure' environment (if that ever
exists), preferably you won't run a public web application as a domain user.
Note also that 'aspnet' is kind of a special account, you don't create
'aspnet' and you don't know it's password, it's called a 'machine account'
and such accounts have their passwords maintained by the security system in
the OS (or don't have passwords at all). Services that run as "aspnet", use
the "machine" name to access network resources when the machine is a members
of an AD domain (W2K or higher). That means that 'aspnet' can access
external resources, provided that you granted the 'machine account' access
privileges to the share.

Willy.

"Dragon" <ta*****@hotmail.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
| Yes, right, How about if two computer in the same domain ?
| Can it be granted ? I am not sure...
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:%2******************@TK2MSFTNGP11.phx.gbl...
| >
| > "Dragon" <ta*****@hotmail.com> wrote in message
| > news:OH**************@tk2msftngp13.phx.gbl...
| > | The ASPNET user in your computer didn't have the permission to access
| > file
| > | on the remote computer.
| > | The remote computer has to grant your ASPNET account to access that
| > file.
| > |
| >
| > Which is not possible as ASPNET is a local account.
| >
| > Willy.
| >
| >
|
|
Mar 17 '06 #7

P: n/a
Hi,

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

"Dragon" <ta*****@hotmail.com> wrote in message
news:OH**************@tk2msftngp13.phx.gbl...
| The ASPNET user in your computer didn't have the permission to access
file
| on the remote computer.
| The remote computer has to grant your ASPNET account to access that
file.
|

Which is not possible as ASPNET is a local account.

Worse, as it's running as a service cannot "mount" remote shares, you have
to use UNC to reach it.
Mar 17 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.