输出服务器端文件到客户端
string MIME = "application/vnd.ms-excel";
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename="+ HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
//设置输出文件类型
Response.ContentType = MIME;
//把文件流发送到客户端
Response.WriteFile(filePath);
Response.Flush();
Response.Close();
Response.End();
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename="+ HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
//设置输出文件类型
Response.ContentType = MIME;
//把文件流发送到客户端
Response.WriteFile(filePath);
Response.Flush();
Response.Close();
Response.End();