- 파일 업로드

- spring-boot MultipartFilter 적용
CommonsMultipartResolver로 multipartResolver 구현 후 MultipartAutoConfiguration 제거해야 MultipartFilter 적용 됨
MultipartAutoConfiguration 제거 후 CommonsMultipartResolver 상속 받아 Custom 후 MultipartFilter 설정 하거나
MultipartFilter 도 상속 받아 Custom 해서 사용 해도 됨

@Autowired
private MultipartProperties multipartProperties;

@Bean
public MultipartResolver multipartResolver() {
    LOG.debug("initializing MultipartResolver");
    MultipartConfigElement config = multipartProperties.createMultipartConfig();
    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
    multipartResolver.setResolveLazily(true);
    multipartResolver.setMaxUploadSize(config.getMaxRequestSize());
    multipartResolver.setMaxUploadSizePerFile(config.getMaxFileSize());
    return multipartResolver;
}


https://stackoverflow.com/questions/38999173/cannot-configure-commonsmultipartresolver-with-spring-boot-1-2-8


- spring upload example
https://www.baeldung.com/spring-file-upload

- MultipartFile, MultipartHttpServletRequest, custom Dto
https://caileb.tistory.com/152

- spring-boot 다중 파일 업로드
https://data-make.tistory.com/m/669

https://gofnrk.tistory.com/36


- 파일 다운로드

- spring-boot download
https://gofnrk.tistory.com/80

- spring download 정리
https://move02.github.io/articles/2020-07/Spring-File-Download












Posted by 張's blog
,