-
-
Save jpukg/5eb559e4694893da730d611cfabf9622 to your computer and use it in GitHub Desktop.
extjs file upload & spring mvc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = MediaType.TEXT_HTML_VALUE) | |
| @ResponseBody | |
| public String upload(@RequestParam("file") MultipartFile file, String name, String message) throws Exception | |
| { | |
| Map<String, Object> resp = Maps.newHashMap(); | |
| FileCopyUtils.copy(file.getBytes(), new File('filename')); | |
| resp.put("success", true); | |
| resp.put("msg", "upload success."); | |
| return JSONObject.toJSONString(resp); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment