SPRINGMVC file upload with data binding for enctype= "Multipart/form-data" form

Source: Internet
Author: User
Tags file upload

Recently started contacting Springmvc, a page of a previous project was copied from the project, and it was found that the form page data could not be bound to the model when the value passed in was all null, and later found that the form form used in the page used

Enctype= "Multipart/form-data", cancel off enctype= "Multipart/form-data" all normal.

Later projects need this business implementation upload attachments, which contradicts before, find the corresponding method, restore the form enctype= "Multipart/form-data" and set in the configuration file

<bean id= "Multipartresolver" class= "Org.springframework.web.multipart.commons.CommonsMultipartResolver" >
    <property name= "defaultencoding" value= "Utf-8" ></property>
    <property name= "Maxuploadsize" Value= "10485760000" ></property>
    <property name= "maxinmemorysize" value= "40960" ></property >
</bean>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.