mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
fix: 设置上传文件最大大小
This commit is contained in:
parent
61cc3b5f07
commit
5e01c1c5a1
src/main
@ -31,7 +31,7 @@ public class FileInterceptor implements HandlerInterceptor {
|
||||
String requestUri = request.getRequestURI();
|
||||
// 缓存10天
|
||||
response.setDateHeader("expires", System.currentTimeMillis() + 60 * 60 * 24 * 10 * 1000);
|
||||
try (OutputStream out = response.getOutputStream();InputStream input = new FileInputStream(fileUploadPath + requestUri)) {
|
||||
try (OutputStream out = response.getOutputStream(); InputStream input = new FileInputStream(fileUploadPath + requestUri)) {
|
||||
byte[] b = new byte[4096];
|
||||
for (int n; (n = input.read(b)) != -1; ) {
|
||||
out.write(b, 0, n);
|
||||
|
@ -6,6 +6,12 @@ spring:
|
||||
jackson:
|
||||
generator:
|
||||
write-numbers-as-strings: true
|
||||
servlet:
|
||||
# 上传文件最大大小
|
||||
multipart:
|
||||
max-file-size: 5MB
|
||||
|
||||
|
||||
|
||||
server:
|
||||
port: 8888
|
||||
|
Loading…
x
Reference in New Issue
Block a user