生产中的文档渲染问题 [英] Document rendering problem in production

查看:91
本文介绍了生产中的文档渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们在项目中面临一个奇怪的问题.我们使用了"Response.BinaryRead"和"Response.BinaryWrite"方法来渲染文档,该文档位于我们项目的虚拟文件夹中.

在传递给Binary读写时,我们已经完成了一个映射路径,该路径在开发和测试中都可以正常工作.

但是在生产过程中,文档将以页面名称本身的形式呈现,并以HTML格式打开.

可能是什么问题呢.提供任何线索.


谢谢

Hello all,

We are facing a strange problem in our project. We have used a "Response. BinaryRead" and "Response. BinaryWrite" methods to render a document which is there in virtual folder in our project.

While passing to Binary read and write we have done a map path which is working fine in development as well as in test.

But in production the document is rendering as the page name itself and opening in HTML format.

What could be the problem. Give any clue.


Thanks

推荐答案

1.首先需要确保正确设置内容类型.
2.如果是asp.net,请执行page_load事件下载,而不要单击任何按钮或类似操作.我遇到了类似的问题.但是问题只存在于IE.在其他浏览器上也可以.将代码带到Page_Load可以为我解决.
3.文件名中的空格字符也可能会引起问题


如果有帮助,请对答案进行评分.
谢谢
Mahmud
1. 1st of all you need to ensure that the content type is set correctly.
2. If it is asp.net, do the download on page_load event instead of any button click or something like that. I faced similar problem. But the problem was there only for IE. It was ok on other browsers. taking the code to Page_Load solved it for me.
3. Spacial character in file name may also create problem


Please rate the answer if it helps.
Thanks
Mahmud


这篇关于生产中的文档渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆