JAVA

간단한 multipart 파일 업로드

인생아 2018. 9. 5. 14:50
반응형
 
 @RequestMapping(value="/test")
 public void test(@RequestParam("file")MultipartFile file) throws Exception {
  FileOutputStream fos = new FileOutputStream("C:\\" + file.getOriginalFilename());
     fos.write(file.getBytes());
     fos.close();
 }
반응형

'JAVA' 카테고리의 다른 글

[JAVA] byte[] 배열을 string[] 배열로 변환  (0) 2018.11.14
jpa 시간 자동 저장 [@CreationTimestamp][@UpdateTimestamp]  (0) 2018.08.24
jpa orderby  (0) 2018.08.10