This commit is contained in:
ran.shang
2025-08-27 14:49:14 +08:00
parent e33f5c1953
commit 7c62035839

View File

@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.catalina.connector.ClientAbortException;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
@@ -104,6 +105,8 @@ public class FileServiceImpl implements FileService {
}
try (OutputStream outputStream = response.getOutputStream()) {
fileStorage.download(fileRecord.getFilePath(), outputStream, fileRecord.getFileSize());
} catch (ClientAbortException e) {
log.warn("客户端主动断开连接: {}", e.getMessage());
}
}