标签:content 参数 header proc download sre sys text void
html部分<a href="ashx?参数">
ashx部分
public override void ProcessRequest(HttpContext context)
{
this.UserID = base.BaseUserID;
this.strAttachGuid = context.Request["AttachGuid"];
byte[] bytes = Download(context);
if (bytes != null)
{
context.Response.Buffer = true;
context.Response.Clear();
context.Response.ContentType = "application/download";
context.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8));
context.Response.BinaryWrite(bytes);
context.Response.Flush();
context.Response.Clear();
context.Response.End();
}
}
标签:content 参数 header proc download sre sys text void
原文地址:https://www.cnblogs.com/chengeng/p/12370684.html