首页 > 编程语言 > 详细

plupload -- multiple file upload & Spring MVC

时间:2014-04-12 06:37:24      阅读:1086      评论:0      收藏:0      [点我收藏+]

Here is the code of the method that is used to process the uploaded files (note: this is just test code that I‘ve been playing around with so it needs some fixing, but it‘ll get you up and running):

public ModelAndView upload(HttpServletRequest request, HttpServletResponse response) throws Exception {
    MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;	
    MultiValueMap<String, MultipartFile> map = multipartRequest.getMultiFileMap();
    if(map != null) {
	Iterator iter = map.keySet().iterator();
	while(iter.hasNext()) {
	    String str = (String) iter.next();
	    List<MultipartFile> fileList =  map.get(str);
	    for(MultipartFile mpf : fileList) {
		//do something by mpf							
            }
        }
    }
    return null;
}


link to http://forum.spring.io/forum/spring-projects/web/94851-html5-multiple-file-upload-spring-mvc

本文出自 “六度空间” 博客,请务必保留此出处http://jasonwalker.blog.51cto.com/7020143/1394456

plupload -- multiple file upload & Spring MVC,布布扣,bubuko.com

plupload -- multiple file upload & Spring MVC

原文:http://jasonwalker.blog.51cto.com/7020143/1394456

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!