MVC 下载相关
前台:
location.href = "/Flow/SB1SP?clxxid=8099b23c-aa5a-44a3-97ef-85eed78145ba";
后台:
publci ActionResult SB1SP()
{
FileStream fs = new FileStream(fileName, FileMode.Open);
byte[] bytes = new byte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("123.mdb"));
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
return ActionResult ();
}