mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
纯粹的图床网站
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package cn.hellohao;
|
||||
|
||||
import javax.servlet.MultipartConfigElement;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@SpringBootApplication
|
||||
@Configuration
|
||||
public class TbedApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TbedApplication.class, args);
|
||||
|
||||
}
|
||||
/**
|
||||
* 文件上传配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public MultipartConfigElement multipartConfigElement() {
|
||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||
// 单个数据大小
|
||||
factory.setMaxFileSize("102400KB"); // KB,MB
|
||||
/// 总上传数据大小
|
||||
factory.setMaxRequestSize("102400KB");
|
||||
return factory.createMultipartConfig();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user