// get the path in the local file system that corresponds to ~/Uploads/Images
string localPath = HttpContext.Current.Server.MapPath("~/Uploads/Images/");
与路径一起使用。合并以创建文件路径:
string fileName = Path.Combine(
HttpContext.Current.Server.MapPath("~/Uploads/Images/"),
"filename.ext");
using (FileStream stream = File.OpenRead(fileName))
{
// read the file
}