gpt4 book ai didi

Tomcat WebDAV强制下载

转载 作者:行者123 更新时间:2023-11-28 23:25:38 25 4
gpt4 key购买 nike

我有一个部署了 WebDAV servlet 的 tomcat 网络服务器。我有可通过 WebDAV 访问的多媒体文件,并希望在通过浏览器访问时强制下载它们,而不是允许浏览器从服务器流式传输它们。我该怎么做呢?

最佳答案

您需要配置 Content-Disposition 头字段。

If the disposition type matches "attachment" (case-insensitively), this indicates that the recipient should prompt the user to save the response locally, rather than process it normally (as per its media type).¶

On the other hand, if it matches "inline" (case-insensitively), this implies default processing. Therefore, the disposition type "inline" is only useful when it is augmented with additional parameters, such as the filename (see below).

Reference

关于Tomcat WebDAV强制下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37542774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com