It depends on your application how its handles file uploads. In a Spring application, it is common to use apache commons FileUpload.
org.springframework.web.multipart.commons.CommonsMultipartResolver
(that extends from CommonsFuleUploadSupport
) has a property uploadTempDir
. That can be used to specifiy where the uploaded file is temporary stored.
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="100000" />
<property name="uploadTempDir" ref="uploadTempDirResource" />
</bean>
<bean id="uploadTempDirResource"
class="org.springframework.core.io.FileSystemResource">
<constructor-arg value="/temp" />
</bean>