spring.servlet.multipart.max-file-size=23KB
spring.servlet.multipart.maxRequestSize=23KB
<form action="fileupload" method="post" enctype="multipart/form-data">
<input type="file" name="filename"/>
<input type="submit" />
</form>
@RestController
public class FileUploadController {
@RequestMapping("/fileupload")
public Map<String,Object> fileUpload(MultipartFile filename) throws Exception {
System.out.println(filename.getOriginalFilename());
System.out.println(filename.getName());
System.out.println(filename.getSize());
Map<String,Object> map = new HashMap<>() ;
filename.transferTo(new File("d:/aaa"));
map.put("msg","ok");
return map;
}