在一个 HTTP 请求中下载多个文件 [英] Download Multiple files in one HTTP request

查看:101
本文介绍了在一个 HTTP 请求中下载多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在一个 HTTP 请求中下载多个文件?我的意思是,当您有多个附件并且您选择要下载的内容然后按下载时,它们将被自动下载,而您不必手动单击每个附件.

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.

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

i'm using PHP as a serverside srcipting.

推荐答案

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

通常,HTTP 将多部分消息体视为与任何其他媒体类型没有什么不同:严格视为有效负载.[…] HTTP 用户代理应该遵循与 MIME 用户代理在收到多部分类型时相同或相似的行为.

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".

但由于 Firefox 是我所知道的唯一支持这种多部分响应的浏览器(除了multipart/byterange),为此您应该使用一些存档文件格式.

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.

这篇关于在一个 HTTP 请求中下载多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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