UnauthorizedAccessException: Access to the path

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
 
P

Patrice

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top