string fileName="",filePath="";
.....
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.ContentType = "application/unknow";
Response.TransmitFile(filePath);
Response.End();
fileName为下载后显示的文件名
filePath服务器上的文件的绝对路径
时间: 2024-11-13 08:14:26