首页 > 代码库 > spring 上传附件

spring 上传附件

jsp:

<form class=‘uk-form‘ action="savelead" method="post" enctype="multipart/form-data" onsubmit="return savelead();">

</form>

传递一个附件

action:

@RequestParam(value = "http://www.mamicode.com/fileexcel", required = false) MultipartFile file

传递多个附件

action:

MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
List<MultipartFile> files= multipartRequest.getFiles("file");

 

spring 上传附件