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 /).
 

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