Created
July 20, 2011 13:30
-
-
Save criminy/1094950 to your computer and use it in GitHub Desktop.
Spring 3 multiple file upload
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
@Controller | |
@RequestMapping(value="/") | |
public class MultipleFileUploadExample | |
{ | |
Logger log = Logger.getLogger(NewController.class); | |
@RequestMapping(method=RequestMethod.POST) | |
public String onMultipleFiles(MultipartHttpServletRequest request) | |
{ | |
final Map<String,MultipartFile> files = request.getFileMap(); | |
for(Entry<String,MultipartFile> e : files.entrySet()) | |
{ | |
log.debug(e.getKey() + " " + e.getValue().getOriginalFilename()); | |
} | |
return "redirect:/"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment