第七章 文件上传
1.表单
2.jar包
commons-fileupload-1.3.jar和commons-io-2.0.1.jar
3.配置CommonsMultipartResolver
注意:id必须是multipartResolver
4.接收数据
①普通数据:和以前一样正常接收 ②文件数据:使用@RequestParam注解注入到MultipartFile类型的入参中
@RequestMapping("/upload")
public String upload(@RequestParam(“picture”) MultipartFile picture) {
return “…”;
}
③MultiPartFile类型
更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/120360848
标签:文件,RequestParam,picture,第九章,Spring,jar,upload,MVC,上传 From: https://www.cnblogs.com/wangchuanxinshi/p/16732047.html