asp.net 下载文件

protected void btnExcelDownload_Click(object sender, EventArgs e)
        {
            Response.ContentType = "application/x-zip-compressed";
            Response.AddHeader("Content-Disposition", "attachment;filename=InstallRecord.zip");
            string filename = Server.MapPath("../ExcelFiles/InstallRecordTemplate.zip");
            Response.TransmitFile(filename);
        }

 

posted @ 2016-06-06 17:12  -H&H-  阅读(119)  评论(0)    收藏  举报