ashx后台
byte[] file =GetFileByte("");
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;Filename=123.pdf");
Response.BinaryWrite(file);
Response.Flush();
Response.End();
js:
var newUrl = "1111.ashx?Action=LoadByID&ID=" + id;
location.href = newUrl;
原文:http://www.cnblogs.com/MSIKRUBY/p/4860963.html