@RequestMapping(value = "/json/uploadAvatar.json", method = RequestMethod.POST) @ResponseBody public String uploadAvatar(@RequestParam("croppedImage") MultipartFile file) { try { InputStream content = file.getInputStream(); String properties = "aliyun-oss.properties"; String filepath = userSitesService.uploadAvatar(properties, content); } catch (Exception ex) { } return null; } <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>