//地址和下载时的文件名称可以通过参数传过来
public ActionResult Index()
{
string filePath = Server.MapPath("/down/vip02.png");//下载地址
FileStream fs = new FileStream(filePath, 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("vip02.png"));//下载文件名称
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
return new EmptyResult();
}