plupload -- multiple file upload & Spring MVC

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

上一篇:用Python实现排序算法——插入排序


下一篇:C++之基于STL的基本学生信息系统开发(vector/algorithm/functional)