日期:2014-05-17 浏览次数:20621 次
string strFileName = str.Split(',')[0];
Response.ContentType = "application/x-zip-compressed";
//Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
string filename = Server.MapPath(strFileName);
string name = str.Split(',')[1];
Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlPathEncode(name));
//Server.UrlPathEncode()解决文件名的乱码问题.
Response.TransmitFile(filename);