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();
请注意注释部分!!
相关文章推荐
- ASP.NET AND EF
- ASP.NET - TreeView
- ASP.NET - TreeView控件,只操作最后一级节点
- 使用 ASP.NET 和 WCF 4.0 开发 RESTful 服务
- asp.net 执行Response.Write后页面变形
- asp.net将sql语句封装在类库中
- asp.net将sql语句封装在类库中
- ASP.NET MVC 入门介绍 (上)
- ASP.NET MVC 入门介绍 (上)
- ASP.NET MVC5网站开发添加文章(八)
- ASP.NET MVC 部分视图
- asp.net自定义控件之加载层
- asp.net验证码的简单制作
- ASP.NET网站页面加载及运行效率等多方面实战优化
- Reading Text-based Files In ASP.NET
- ASP.NET MVC4系列验证机制、伙伴类共享源数据信息(数据注解和验证)
- ASP.NET MVC3手把手教你构建Web
- [Asp.net]Uploadify上传大文件
- ASP.NET MVC5网站开发文章管理架构(七)
- ASP.NET MVC5网站开发用户修改资料和密码(六)