I using developing a RESTFul web service using Maven and Spring Roo.
In my configuration xml file I defined a multipartResolver
bean because I am uploading files of 300KB:
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="400000" />
<property name="maxInMemorySize" value="400000" />
</bean>
The files are uploaded successfully and pushed into a stack. These file are CommonsMultipartFile
or MultipartFile
objects (I have the same phenomenon for both type of objects). Once I pop a file, I can call getSize()
method and I can verify that the size of the file is correct. But once I call getInputStream()
I get the following error: File has been moved - cannot be read again.
Did I do something wrong in my multipartResolver
declaration? Is there any other reason to have this error?
Thank you