user1129492
user1129492

Reputation: 11

System.IO.DirectoryNotFoundException: Could not find a part of the path

I have 1 service app(asp.net) that will upload txt file. I would like to upload the file to network share drive. example of network mapped drive: Z:\HR\hr\t\clock. If i run the web page throught visual web developer, it can successfully save the file. but if i run the web page directly via IE, it cannot save. I already set the network folder for everyone is full control right. it throw an exception System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z:\HR\t\clock102528122011113418.txt'.

Thanks

Upvotes: 1

Views: 6315

Answers (1)

csharpnumpty
csharpnumpty

Reputation: 3723

That will be because of Security Contexts I would think.

Running it from VWD runs under your security context, running "directly from IE" will run under a different context (Traditionally, IUSR_MachineName)

One scenario you have an account that has permissions, the other you do not.

I would recommend creating a service account to do the work and give that the least permissions possible and go from there.

Upvotes: 2

Related Questions