Skip to main content

MultipartFile

Learn MultipartFile (File Upload & Download, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes MultipartFile : the Spring interface that represents one uploaded file in a multipart request; you receive it as a controller parameter. Main methods : getOriginalFilename() , getSize() , getContentType() , isEmpty() , getBytes() and transferTo(Path) . Save a file with file.transferTo(target) ; the temporary data is deleted after the request, so you must copy it if you want to keep it.

More lessons in File Upload & Download