|
@@ -45,8 +45,11 @@ public class ServletUtils {
|
|
|
public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException {
|
|
|
// 设置 header 和 contentType
|
|
|
if (filename.contains("mp4")) {
|
|
|
- response.setHeader("Content-Disposition", "inline;Accept-Ranges: bytes;Cache-Control: no-store;Pragma: no-cache");
|
|
|
+ response.setHeader("Content-Disposition", "inline");
|
|
|
response.setContentType("video/mp4");
|
|
|
+ response.setHeader("Accept-Ranges","bytes");
|
|
|
+ response.setHeader("Cache-Control","no-store");
|
|
|
+ response.setHeader("Pragma","no-cache");
|
|
|
} else {
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
|
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|