MultipartFile(文件的上传)
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="defaultEncoding" value="utf-8" /> <property name="maxUploadSize" value="10485760000" /> <property name="maxInMemorySize" value="40960" /> </bean>
@RequestMapping("/doUpload.do") public ModelAndView doUpload(MultipartFile upfile) { String filename = upfile.getOriginalFilename(); long bytes=upfile.getSize(); System.out.println(filename); ModelAndView mv = new ModelAndView(); mv.addObject("msg","upload ok"); return mv; }
今日事今日毕