Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Commented Unassigned: 通过网页下载xlsx文件报错,丢失文件 [13361]

$
0
0
运行代码:

FileStream file = new FileStream("test.xlsx", FileMode.Open, FileAccess.Read);//读入excel模板
var workbook = new XSSFWorkbook(file);
MemoryStream ms = new MemoryStream();
workbook.Write(ms);//写入内存流
byte[] data = ms.ToArray();
HttpResponse response = System.Web.HttpContext.Current.Response;
response.Clear();
response.Charset = "UTF-8";
response.ContentType = "application/vnd-excel";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment; filename=abc.xlsx"));
System.Web.HttpContext.Current.Response.BinaryWrite(data);
Comments: ** Comment from web user: tonyqus **

经测试,用2.1.3不能重现您的问题。请自行寻找原因,如果有预算,可以发邮件到support@neuzilla.com上个case,我们会提供远程协助,帮你排查问题。


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>