Tomcat WebDAV强制下载

标签 tomcat tomcat8

我有一个部署了 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/

相关文章:

Tomcat --> Glassfish/lib 目录

java - 获取 HTTP 状态 404 - 502.shtml 请求的资源不可用。上传文件时

java - jsp 上没有打印任何内容来添加模型对象

tomcat - 嵌入式 tomcat 无法从类加载器层次结构中扫描 jar

java - 如何在网络应用程序中动态更新(热插拔) jar ?

mysql - Tomcat7 MySQL 连接错误

spring - 如果使用 Spring 而不使用 EJB,Glassfish 是否有点矫枉过正?

java - 碧 Jade 听众?从 Tomcat 8 升级到 Tomcat 9

java - Tomcat 8.0.18 未收到客户端的完整请求

java - 文件上传在 spring mvc 和 tomcat6 中不起作用