可能原因是:multipartResolver没有配置正确
请看解决方案:
<!--文件上传 id必须为multipartResolver,不然报错HTTP Status 400 – Bad Request--> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="defaultEncoding" value="UTF-8"/> <!--5M--> <property name="maxUploadSizePerFile" value="5242880"/> <property name="uploadTempDir" value="file:/tmp"/> </bean>
原文地址:https://www.cnblogs.com/adeng/p/8806772.html
时间: 2024-10-09 14:09:02