@听风2008: 有个方法是将绝对路径转到服务器路径。Server.MapPath(upPath) 这个方法就是把你那个路径变成服务器路径。var domain = System.Configuration.ConfigurationManager.AppSettings["Domain"];
HttpFileCollection hfc = System.Web.HttpContext.Current.Request.Files;
string upFileType = "|image/bmp|image/x-png|image/pjpeg|image/gif|image/png|image/jpeg|";
int upLength = 5;
string imgPath = "";
string upPath = "/upload/"; //上传文件路径
if (hfc.Count > 0)
{
string fileContentType = hfc[0].ContentType; //文件类型
if (upFileType.IndexOf(fileContentType.ToLower()) > 0)
{
string name = hfc[0].FileName; // 客户端文件路径
FileInfo file = new FileInfo(name);
string fileName = name.Substring(0, name.IndexOf(file.Extension)) + "_" + DateTime.Now.ToString("yyyyMMddhhmmssfff") + file.Exten