当我生成并下载.docx文件时,无法打开。 我试图将“ testfile.docx”重命名为“ testfile.zip”, 打开的zip文件和.docx正常工作。
有什么方法可以打开.docx而不将其转换为.zip?
[HttpGet()]
[Produces ("application/vnd.openxmlformats-officedocument.wordprocessingml.document")]
[Route ("settings/w/{id}")]
public async Task<IActionResult> ExportAcceptanceActWord (int id) {
var model = Repository.GetAcceptanceActs ().Where(c=>c.ID==id).SingleOrDefault();
var viewHtml = await this.RenderViewAsync ("AcceptanceAct", model);
byte[] str= viewHtml.HTML2WordDocument();
return File (str, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "aa.docx");
}