spring MVC 文件上传错误
2024-10-20 06:34:18
1.The request sent by the client was syntactically incorrect ()
http://luanxiyuan.iteye.com/blog/1876029
问题原因,无法接收参数。
可能原因,参数名称不正确,获取接收参数为空,如果可能为空,可设置如下
@RequestParam(value = "file", required = false) MultipartFile file
2.如果参数设置正常,后台controller接收到的文件为null
可能没有添加配置
http://bbs.csdn.net/topics/390803763
配置文件中添加:
<!-- id="multipartResolver"必须是multipartResolver -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- maxUploadSize:文件上传的最大值以byte为单位 -->
<property name="maxUploadSize" value="1024000"></property>
</bean>
最新文章
- iOS开发系列--UITableView全面解析
- WCF入门教程(二)如何创建WCF服务
- Python 小问题解决
- ANYBUS AB9005-B配置
- MyEclipse调用Matlab打包函数
- mongo3.x ssl版安装文件
- Ioc 比较
- 缓存淘汰算法 (http://flychao88.iteye.com/blog/1977653)
- Android面试题06
- 30天自制操作系统第八天学习笔记(u盘软盘双启动版本)
- linux视频学习3(linux安装,shell,tcp/ip协议,网络配置)
- javascript-array函数实例
- 继承“HibernateDaoSupport”后,报“The hierarchy of the type AccoutDaoImpl is inconsistent”的解决方案
- ruby中如何直接编译运行C代码
- java连Oracle连接字符串写法
- Shell 批量修改主机 用户密码
- 使用IDEA部署项目到远程服务器
- ⌈洛谷4735⌋⌈BZOJ3261⌋最大异或和【可持久化01Trie】
- Redis集群部署-windows
- Yii2.0 发送邮件时中文附件乱码的问题
热门文章
- ln: 正在创建指向“asm-arm”的符号链接“asm”: 不支持的操作
- Arcgis Engine(ae)接口详解(4):featureClass的feature插入
- Python开发【2.3 模块】
- python day - 17 面向对象的 类空间 和 组合
- C语言文件读写Demo
- 20170228 METHOD handle_data_changed-
- window.name应用于浏览器端数据存储
- 广大暑假训练1(poj 2488) A Knight&#39;s Journey 解题报告
- JQuery验证成功之后,使用ajax提交数据
- UIFont 字体样式 [UIFont fontWithName~];