In the Jqueryfileupload upload file times the following error:
Java.lang.IllegalStateException:File have been moved-cannot be read again
The background interface is Spring MVC, which examines the Sprnig MVC configuration file:
<bean id= "Multipartresolver" class= "Org.springframework.web.multipart.commons.CommonsMultipartResolver" > <property name= "Maxuploadsize" ><value>102400000</value></property></bean>
You have configured the maximum size allowed to upload files, and the size of your uploaded files is much smaller than this, what is the case?
After searching the data online, we found that spring MVC, in addition to the Maxuploadsize parameter, has a maxinmemorysize parameter that specifies the maximum number of Szie to allow the file to be written to memory. The default is 1024 bytes, that is, 1MB, if you try to upload a file larger than 1024 bytes, you need to increase the maxinmemorysize price.
As follows:
<beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "xmlns:p=" http://www.springframework.org/schema/p "xmlns:context="/HTTP/ Www.springframework.org/schema/context "xsi:schemalocation=" Http://www.springframework.org/schema/beans/http Www.springframework.org/schema/beans/spring-beans-4.0.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/context/spring-context-4.0.xsd "><!--Add interceptors--><bean id=" Handlermapping "class=" org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping ">< Property name= "Interceptors" ><bean class= "Com.message.web.interceptor.SessionInterceptor"/></ property></bean> <!--Configuring the Controller scan--><context:component-scan base-package= " Com.message.web.controller "/><!--configuration Springmvc View resolver--><bean class=" Org.springframework.web.servlet.view.InternalResourceViewResolver "><propeRty name= "Viewclass" ><value>org.springframework.web.servlet.view.jstlview</value></property ><property name= "prefix" ><value>/message/</value></property><property name= "suffix "><value>.jsp</value></property></bean><!--set the maximum size of the uploaded file to 100MB--><bean id=" Multipartresolver "class=" Org.springframework.web.multipart.commons.CommonsMultipartResolver "><property Name= "Maxuploadsize" ><value>102400000</value></property><property name= "maxInMemorySize "><value>10240000</value></property></bean></beans>
Java.lang.IllegalStateException:File have been moved-cannot be read again