更改内容类型 [英] Changing content type

查看:62
本文介绍了更改内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个网页提供,比方说,一个pdf文件。页面是

密码保护,因此它显示HTML,但当用户登录

时,页面将重新加载window.location.reload(true)。 ,但是

IExplorer不够聪明,意识到内容类型已经改变了,并且只是将pdf吐出到屏幕上。怎么解决这个问题?


谢谢!


Aaron

解决方案

Aaron Fude写道:


我有一个网页提供,比方说,一个pdf文档。页面是

密码保护,因此它显示HTML,但当用户登录

时,页面将重新加载window.location.reload(true)。 ,但是

IExplorer不够聪明,意识到内容类型已经改变了,并且只是将pdf吐出到屏幕上。如何解决这个问题?



解析错误。请重申您的要求。


< http://www.jibbering.com/faq/#FAQ2_3>

PointedEars

-

使用任何版本的Microsoft Frontpage创建您的网站。

(这不会阻止人们查看您的来源,但没有人

会想要窃取它。)

- 来自< http://www.vortex-webdesign.com/help/hidesource.htm>


7月17日,2:42 * pm,托马斯''PointedEars''Lahn< PointedE ... @ web.de>

写道:
< blockquote class =post_quotes>
Aaron Fude写道:


我有一个网页提供,比方说,一个pdf文档。页面是

密码保护,因此它显示HTML,但当用户登录

时,页面将重新加载window.location.reload(true)。 ,但是

IExplorer不够聪明,意识到内容类型已经改变了,并且只是将pdf吐出到屏幕上。如何解决这个问题?



解析错误。 *请重申您的要求。



好​​的,公平的。让我试着从这个角度来看待这个问题。这是我的页面上服务器大小的
伪代码。


if(user.notLoggedIn()){

present.html.login.form();

when(user.submits.login.information)

window.location.reload(true);

}


else {//现在用户已登录...

output.a.pdf.file(); < br $>
}


在这种情况下发生的是,不是调用acrobat

阅读器,而是html文件的原始内容是显示在屏幕上。


这样做会更好吗?


谢谢!


< blockquote> Aaron Fude< aa ******* @ gmail.comwrites:


else {//现在该用户已登录...

output.a.pdf.file();

}



我建议问题出在这里。 *你如何*输出pdf?


在这种情况下发生的是,而不是调用acrobat

阅读器,原始内容html文件的显示在屏幕上。


这样做更有意义吗?



-

Joost Diepenmaat |博客: http://joost.zeekat.nl/ |工作: http://zeekat.nl/

Hi,

I have a webpage delivers, let''s say, a pdf document. The page is
password protected so itially it shows HTML, but when the user logs in
the page is reloaded with "window.location.reload(true)", but
IExplorer is not smart enough to realize that the content type has
changed and just spits out pdf onto the screen. How does one fix that?

Thanks!

Aaron

解决方案

Aaron Fude wrote:

I have a webpage delivers, let''s say, a pdf document. The page is
password protected so itially it shows HTML, but when the user logs in
the page is reloaded with "window.location.reload(true)", but
IExplorer is not smart enough to realize that the content type has
changed and just spits out pdf onto the screen. How does one fix that?

Parse error. Please restate your request.

<http://www.jibbering.com/faq/#FAQ2_3>
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won''t prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>


On Jul 17, 2:42*pm, Thomas ''PointedEars'' Lahn <PointedE...@web.de>
wrote:

Aaron Fude wrote:

I have a webpage delivers, let''s say, a pdf document. The page is
password protected so itially it shows HTML, but when the user logs in
the page is reloaded with "window.location.reload(true)", but
IExplorer is not smart enough to realize that the content type has
changed and just spits out pdf onto the screen. How does one fix that?


Parse error. *Please restate your request.

OK, fair enough. Let me try to approach this from this angle. Here''s
pseudo code for my page on the server size.

if (user.notLoggedIn()) {
present.html.login.form();
when (user.submits.login.information)
window.location.reload(true);
}

else { // Now that the user has logged in...
output.a.pdf.file();
}

What happens in this scenario is that rather than invoking the acrobat
reader, the raw contents of the html file are displayed on the screen.

Does that make better sense?

Thanks!


Aaron Fude <aa*******@gmail.comwrites:

else { // Now that the user has logged in...
output.a.pdf.file();
}

I suggest the problem is here. *How* do you output the pdf?

What happens in this scenario is that rather than invoking the acrobat
reader, the raw contents of the html file are displayed on the screen.

Does that make better sense?


--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


这篇关于更改内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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