[c#]代码库
public void ProcessRequest(HttpContext context)
{
string ID = context.Request["FID"].ToString();
DataTable DTFile = Common.NoPager2("files", "", "FILENAME,IMGFILE", "", "FILEID='" + ID + "'").Tables[0];
string FileName = DTFile.Rows[0]["FILENAME"].ToString().Trim();
FileName = FileName.Substring(19);
if (DTFile != null)
{
context.Response.Clear();
context.Response.ContentType = "application/x-msdownload";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(FileName));
context.Response.BinaryWrite((byte[])DTFile.Rows[0]["IMGFILE"]);
context.Response.Flush();
context.Response.End();
}
}
by: 发表于:2018-01-03 10:42:43 顶(0) | 踩(0) 回复
??
回复评论