【Java】File has already been moved - cannot be transferred again错误

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

默认大小为 10KB

【Java】File has already been moved - cannot be transferred again错误

修改方法:

@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最大值

以上是 【Java】File has already been moved - cannot be transferred again错误 的全部内容, 来源链接: utcz.com/a/102010.html

回到顶部