UnauthorizedAccessException: Access to the path

  • Thread starter Thread starter Iain
  • Start date Start date
I

Iain

All,

I am getting an error with the following code :

FileUpload1.PostedFile.SaveAs("//myserver/MyDirectory);

When trying to write to this directory the following error is returned :

UnauthorizedAccessException: Access to the path

This directory exists but for some reason I can't access it via my
ASP.NET application.

I have granted NETWORK_SERVICE access to this folder.

On my dev environment this error doesn't appear.

Windows Server version is 2007.

Any ideas?

Iain
 
Hello,

AFAIK, when something runs under NETWORK SERVICE it is seen as <machine
name>$ by other servers. Also the network share also has permissions.

Unrelated but my personal preference would be to use \\myserver\MyDirectory
(Windows uses \, http uses /).
 
Back
Top