Tag Archives: Request processing failed;nested exception is org.springframework.web.multipart.MultipartException:Failed to parse multipart servlet request;multipart/formdata request failed.(**

[Solved] Upload Files Request processing failed;nested exception is org.springframework.web.multipart.MultipartException:Failed to parse multipart servlet request;multipart/form-data request failed.(**No permission**)

During a project development, the front-end uploaded a file and reported a bug without permission

Problem description

Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; Needed exception is org.apache.commons.fileupload.fileuploadbase $iofileuploadexception: processing of multipart/form data request failed

Error reporting reason

It should be because HTTP remote access does not have permission to access the temporary directory of Tomcat on the server

So we might as well directly set a temporary file upload path instead of using the default path of Tomcat

Solution:

Modify the uploaded temporary file path instead of the default temporary file path of Tomcat

When uploading the configuration file in applicationcontext.xml of spring, add

<property name="uploadTempDir" value="/temp"/>

The content in value is the temporary file directory you want to set