I am developing spring mvc application with framework 3.2.3.RELEASE
In my application, I handle Multipart using StandardServletMultipartResolver, but with apache commons-fileupload 1.3 everything is the same.
I would like to know why the implementation of the isMultipart method only considers the POST method and not the PUT method. If I want to update the entity and the associated file, I have to do it with POST.
Looking at org.springframework.web.multipart.support.Standard ServletMultipartResolver:
public boolean isMultipart(HttpServletRequest request) { // Same check as in Commons FileUpload... if (!"post".equals(request.getMethod().toLowerCase()) ) { return false; } String contentType = request.getContentType(); return (contentType != null && contentType.toLowerCase().startsWith("multipart/")); }
and in org.apache.commons.fileupload.servlet.ServletFileU I have:
public static final boolean isMultipartContent(HttpServletRequest request) { if (!POST_METHOD.equalsIgnoreCase(request.getMethod() )) { return false; } return FileUploadBase.isMultipartContent(new ServletRequestContext(request)); }
Not vital, really just use the POST method to work PUT. But I want to understand why PUT is not counted!
Thanks for any answer Marco
source share