how to get the servername + foldername without containing the script name?
string filePath = Request.QueryString.Get("filepath");
string serverPath = Request.ServerVariables["SERVER_NAME"] + "/";
string fullUrl = "http://" + serverPath + filePath;
Response.Write(fullUrl);
the above code is missing folder name.
This page demonstrates how the parts of a HttpRequest break down. You could take the
Request.FilePathand remove the final segment like so: