//转换成流字节,输出浏览器下载
var byti = file.SaveToStream().GetBuffer();
////通知浏览器保存文件,其实也就是输出到浏览器
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);
Response.BinaryWrite(byti);
Response.Flush();
Response.Close();
时间: 2024-12-26 15:36:58