String ImgUrl2 = context.Request.QueryString["ImgUrl"];
String ImgUrl = ImgUrl2.Substring(0, ImgUrl2.Length - (ImgUrl2.Length - ImgUrl2.LastIndexOf(‘@‘)));
String ImgName = ImgUrl.Substring(ImgUrl.LastIndexOf(‘/‘)+1, ImgUrl.Length-ImgUrl.LastIndexOf(‘/‘)-1);
context.Response.ContentType = "image/jpeg";
context.Response.AddHeader("Content-Disposition", "attachment;filename=" + ImgName + "");
string filename = context.Server.MapPath(ImgUrl);
context.Response.TransmitFile(filename);
context.Response.End();
时间: 2024-10-17 16:05:14