如何在一个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.
更多推荐
发布评论