(c#)发送文件下载
1
Response.ClearContent();
2
Response.ClearHeaders();
3
Response.ContentType = contentType;
4
//Response.ContentEncoding = System.Text.Encoding.UTF8;
5
//Response.Charset = "utf-8";
6
Response.AddHeader("Content-Disposition:", "attachment; filename=" + Server.UrlEncode(fileName));
7
8
Response.WriteFile(DiskFileName);
9
Response.Flush();
10
Response.Close();
11
12
System.IO.File.Delete(DiskFileName);
Response.ClearContent();2
Response.ClearHeaders();3
Response.ContentType = contentType;4
//Response.ContentEncoding = System.Text.Encoding.UTF8;5
//Response.Charset = "utf-8";6
Response.AddHeader("Content-Disposition:", "attachment; filename=" + Server.UrlEncode(fileName));7
8
Response.WriteFile(DiskFileName); 9
Response.Flush();10
Response.Close();11
12
System.IO.File.Delete(DiskFileName);
浙公网安备 33010602011771号