Search code examples
c#asp.net-mvcserver.mappath

Server.MapPath on a remote server


I have 4 front end servers. Only one of those servers (lets call it server A) has a bunch of images and documents.

Now, I have this line of code that works in a single front end environment

HttpContext.Server.MapPath("/temp");

Now, what I'd like to do is refer to the mapped path of the /temp folder not of the server that the user hits from the load balancer but the mapped path of the /temp folder of server A.

How is this possible?


Solution

  • I think you'd be better off storing the resource folder location in config of the website and using System.IO.Path.Combine to map paths.