我有一个部署了 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).
关于Tomcat WebDAV强制下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37542774/