Question

I have a Asp.net Application where i am attempting to save my files on a shared network drive.

 StrPath = HttpContext.Current.Server.MapPath(@"\\server\c\DTA\");

But i get an error unable to find path

What should be done is it possible to save files in a shared network drive

Was it helpful?

Solution

MapPath is used to map a virtual path of your webserver to a physical path on the hard drive. What you have is already a physical path, so you can just use it to create the file directly.

var fileStream = File.Create(@"\\server\c\DTA\");
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top