feat: 200M 文件限制
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
package com.adc.da.main.file;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.util.unit.DataSize;
|
||||||
|
|
||||||
|
import javax.servlet.MultipartConfigElement;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class FileUploadConfiuration {
|
||||||
|
@Bean
|
||||||
|
public MultipartConfigElement multipartConfigElement() {
|
||||||
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||||
|
//单个文件大小500mb
|
||||||
|
factory.setMaxFileSize(DataSize.ofMegabytes(200L));
|
||||||
|
//设置总上传数据大小10GB
|
||||||
|
factory.setMaxRequestSize(DataSize.ofGigabytes(10L));
|
||||||
|
|
||||||
|
return factory.createMultipartConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user