下载期间显示普通页面 [英] Displaying normal pages during a download

查看:76
本文介绍了下载期间显示普通页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



您知道在CP上的文章下载链接如何引导您进入正常的CP下载页面,即使URL中的地址也是如此bar以.zip结尾,是你正在下载的文件的URL吗?



有人可以告诉我这种行为是如何实现的,所以我可以在我自己的网站上做同样的事情吗?我不知道我应该用谷歌搜索的条款。



干杯。 : - )

Hi Guys,

You know how here at CP the download links on articles lead you to a normal CP "download" page even though the address in the URL bar ends with ".zip" and is the URL of the file you are downloading?

Could someone throw me a lead on how this sort of behaviour is implemented so I can do the same on my own site? I don't know the terms I should be googling for.

Cheers. :-)

推荐答案

文件名不影响内容类型。换句话说,以.zip结尾的URL可以提供实际上是HTML或其他任何内容的资源。以下是它的实现方式:content-type是定义HTTP响应进一步处理的HTTP头之一。

请参阅:

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol [ ^ ],

http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields [ ^ ],

http://en.wikipedia.org/ wiki / Internet_media_type [ ^ ]。



-SA
The file name does not affect the content type. In other words, the URL which ends with ".zip" can provide a resource which is actually HTML, or anything else. Here is how it is implemented: "content-type" is one of the HTTP headers which defines further processing of an HTTP response.
Please see:
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol[^],
http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields[^],
http://en.wikipedia.org/wiki/Internet_media_type[^].

—SA


这篇关于下载期间显示普通页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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