public ActionResult DownloadBook(Letter letter) { XWPFDocument doc = RollExcelManager.SaveWord(letter); MemoryStream ms = new MemoryStream(); doc.Write(ms); ms.Flush(); byte[] fileContents = ms.ToArray(); return(File(fileContents, "application/octet-stream", string.Format("{0}-{1}.docx", letter.Name, letter.Book.GetDescription()))); }
public ActionResult DownloadWord() { XWPFDocument doc = RollExcelManager.SaveWord(Core.RollViewManager.GetRollList(BREnum.Black, null, true)); MemoryStream ms = new MemoryStream(); doc.Write(ms); ms.Flush(); byte[] fileContents = ms.ToArray(); return(File(fileContents, "application/octet-stream", "黑名单公告.docx")); }