mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复本地存储下载时,错误的 contentType 类型导致无法正常下载的问题
This commit is contained in:
@@ -185,11 +185,12 @@ public class LocalServiceImpl extends ProxyTransferService<LocalParam> {
|
||||
|
||||
String fileName = file.getName();
|
||||
headers.setContentDispositionFormData("attachment", StringUtils.encodeAllIgnoreSlashes(fileName));
|
||||
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentLength(file.length())
|
||||
.contentType(MediaType.APPLICATION_OCTET_STREAM)
|
||||
.body(new FileSystemResource(file));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user