From an ASP.NET MVC app I am trying to concatenate two paths, a remote server path with a path extracted from database. I am performing below:
string serverPath = @"\\myServer\TempFolder";
string filePath = GetPathFromDatabaseTable();
string finalPath = System.IO.Path.Combine(serverPath, filePath);
GetPathFromDatabaseTable method returns this string:
\\path\\to\\file.pdf
When concatenating using Path.Combine, the result got into finalPath is:
\\path\\to\\file.pdf
So the prefix serverPath \myServer\TempFolder is removed. Why is happening?