public static string MapServerPath(this HttpServerUtilityBase httpServerUtility, string localPath) { string domainRootLocalPath = httpServerUtility.MapPath("/"); string relativeLocalPath = ExtendedPath.GetRelativePath(domainRootLocalPath, localPath); string serverPath = relativeLocalPath.Replace('\\', '/'); return(serverPath); }
public static string GetExternalLinkFromLocalPath(string fullLocalPath, string baseLocalPath, string baseUrl) { var relativePath = ExtendedPath.GetRelativePath(baseLocalPath, fullLocalPath); var relativeUrl = relativePath.Replace("\\", "/"); var fullUrl = UrlPath.Combine(baseUrl, relativeUrl); return(fullUrl); }