您的位置:首页 > 编程语言 > ASP

Aspose.Words 直接写response导出docx文档显示文件已损坏需要修复的解决办法

2015-09-16 23:37 711 查看
使用Aspose.Words的Document.Save(HttpResponse response, string fileName, ContentDisposition contentDisposition, Aspose.Words.Saving.SaveOption saveOption)方法,将Document直接写入response时,需要加Response.End();

Document doc = new Document(postedFile.InputStream);
doc.Save(Response, dstFileName, ContentDisposition.Inline, SaveOptions.CreateSaveOptions(dstFormat));
// Required. Otherwise DOCX cannot be opened on the client (probably not all data sent
// or some extra data sent in the response).
Response.End();


请注意注释部分!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: