标签:
var path = " FramePath" ;
var filePath = Server.MapPath(path);
if (System.IO.File.Exists(filePath))
{
var fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(filePath);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FrameName + ".zip", System.Text.Encoding.UTF8).Replace("+", "%20"));
Response.AppendHeader("Content-Length", info.Length.ToString());
Response.WriteFile(filePath);
Response.Flush();
Response.End();
return new EmptyResult();
}
标签:
原文地址:http://www.cnblogs.com/etong/p/4353656.html