파일

    [Spring] 스프링 - File Upload, Download

    파일 업로드 / 다운로드 1. pom.xml에 commons-fileupload 추가 commons-fileupload commons-fileupload 1.4 2. servlet-context에 multipartResolver 추가 defaultEncoding = 인코딩 방식 maxUploadSize= 최대 업로드 크기, -1인 경우 무한 3. form 수정 ... method: POST, enctype=”multipart/form-data”로 설정 이미지 파일만 받고싶은 경우 accept="image/*" 4. ProductController @PostMapping("/product/regist") public String regist(Model model, @RequestPart(required =..

출처: https://gmnam.tistory.com/157 [Voyager:티스토리]