在一个HTTP请求中下载多个文件(Download Multiple files in one HTTP request)

编程入门 行业动态 更新时间:2024-10-26 16:27:47
在一个HTTP请求中下载多个文件(Download Multiple files in one HTTP request)

如何在一个HTTP请求中下载多个文件? 我的意思是这就像当你有多个附件时,你选择你想要下载的东西,然后按下载,这样它们将被自动下载,你不必手动点击每一个附件。

我使用PHP作为服务器端srcipting。

how is it possible to download multiple files in one HTTP request? what i mean it's like when you have multiple attachments and you select what you want to download then press download so they will be automaticcaly downloaded and you don't have to click on each one manually.

i'm using PHP as a serverside srcipting.

最满意答案

可以在HTTP中发送多部分响应 :

通常,HTTP将多部分消息体与其他任何媒体类型视为相同:严格地说是有效载荷。 HTTP用户代理应该在收到多部分类型时遵循与MIME用户代理相同或相似的行为。

[...]如果应用程序收到无法识别的多部分子类型,则应用程序必须将其视为等同于“多部分/混合”。

但是由于Firefox是我知道支持这种多部分响应的唯一浏览器(除多部分/字节范围之外 ),因此您应该使用某种归档文件格式来实现此目的。

It is possible to send a multipart response in HTTP:

In general, HTTP treats a multipart message-body no differently than any other media type: strictly as payload. […] an HTTP user agent SHOULD follow the same or similar behavior as a MIME user agent would upon receipt of a multipart type.

[…] If an application receives an unrecognized multipart subtype, the application MUST treat it as being equivalent to "multipart/mixed".

But since Firefox is the only browser that I know about to support such multipart responses (apart from multipart/byterange), you should use some archive file format for this purpose.

更多推荐

本文发布于:2023-07-07 09:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1061423.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   文件   HTTP   Download   request

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!