@Bean public MultipartConfigElement multipartConfigElement(){ MultipartConfigFactory factory = new MultipartConfigFactory(); // 单个数据大小 10M factory.setMaxFileSize("10240KB"); /// 总上传数据大小 10M factory.setMaxRequestSize("10240KB"); return factory.createMultipartConfig(); }