open file across network

  • Thread starter Thread starter Wanda
  • Start date Start date
W

Wanda

Hi,

I tried to open a file in aspnet:

FileOpen(intFile, "\\MachineName\path\subfolder\filename",
OpenMode.Output)

However, I received the following error message:
System.UnauthorizedAccessException: Access to the path
"\\MachineName\path\subfolder\filename" is denied.

but it works ok if I provide a mapped path: namely
"c:\path\subfolder\filename"

What kind of setting I have to make in order to allow me to use
"\\MachineName" without mapping?

Thanks in advance. Any help would be greatly appreciated.

Wanda
 
The default ASPNET user account doesn't have network permissions.
One solution is to change ASP.NET to run under a different account that has
the necessary permissions. For testing purposes I suggest having it run
under your user account since you know you have permission.

For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyAppUser">
password="password"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 

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

Back
Top