补充一下,本地打开excel,这里是显示正常的,前端请求的方法用的http://blog.gcpowertools.com.cn/ ... n-Server-Excel.aspx, 服务器端返回的是用 :
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";//xlsx
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(""));
HttpContext.Current.Response.OutputStream.Write(buffer, 0, buffer.Length);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End(); |