关于java:File-has-already-been-moved-cannot-be-transferred-again错误

54次阅读

共计 334 个字符,预计需要花费 1 分钟才能阅读完成。

起因是因为前端上传文件大小超过阀值限度

默认大小为 10KB

批改办法:

@Configuration
public class MultipartResolverConfig {
    @Bean
 public CommonsMultipartResolver multipartResolver(){CommonsMultipartResolver resolver = new CommonsMultipartResolver();
 resolver.setDefaultEncoding("UTF-8");
 resolver.setMaxInMemorySize(Integer.MAX_VALUE);
 return resolver;
 }
}

将 maxInMemorySize 属性适当减少,最大值为 int 最大值

正文完
 0