MultipartException: Failed to parse multipart servlet request;

I have a spring boot application with multipart enabled, I am getting below Error when uploading the files:

ERROR org.apache.juli.logging.DirectJDKLog(DirectJDKLog.java(175)) : Servlet.service() for servlet [dispatcherServlet] in context with path [/msu] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: java.io.EOFException: Unexpected EOF read on the socket] with root causejava.io.EOFException: Unexpected EOF read on the socket

Please help to resolve this.

3 Likes

Removing the headers can work

Commenting out this line below solve the issue

headers.append(‘Content-Type’, ‘multipart/form-data’)

3 Likes