| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 |
Tags
- cross-cutting concerns
- assertJ
- 프로그래머스
- TDZ
- optimistic lock
- propagation
- 단어변환
- Java
- Generic method
- wrapper class
- NestJS 요청흐름
- SPOF
- CORS
- COPYOFRANGE
- IllegalStateException
- hoisting
- HandlerMethod
- API
- Transaction
- CQS
- generic type
- 벌크연산
- #@Transacional
- ExceptionResolver
- pessimistic lock
- type eraser
- tracking-modes
- RequestMappingHandlerMapping
- 역정규화
- demand paging
Archives
- Today
- Total
jingyulog
Spring File Upload 본문
- 스프링은 MultipartFile 이라는 Interface 로 Multipart File을 매우 편리하게 지원한다.
- 업로드하는 HTML Form의 name에 맞춰서 @RequestParam 혹은 @ModelAttribute 를 적용하면 된다.
- @RequestParam MultipartFile file
- @ModelAttribute MultipartFile file
- MultipartFile 주요 메서드
- file.getOriginalFilename() : 업로드 파일명 가져오기
- file.transferTo( new File(저장 경로) ) : 파일 저장
'Tech > 스프링' 카테고리의 다른 글
| Escape (0) | 2023.02.19 |
|---|---|
| PRG (Post/Redirect/Get) (0) | 2023.02.18 |
| Servlet File Upload (0) | 2023.02.18 |
| MultipartResolver (0) | 2023.02.18 |
| multipart 사용 옵션 (0) | 2023.02.18 |