I'm developing a spring mvc app with framework 3.2.3.RELEASE
In my app I handle Multipart with StandardServletMultipartResolver, but with apache commons-fileupload 1.3 the things are the same.
I would like to know why the implementation of isMultipart method take in account only POST method, and not PUT method. If I want to update an entity and the related file I must do it with a 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/"));
}
while in org.apache.commons.fileupload.servlet.ServletFileU pload I have:
public static final boolean isMultipartContent(HttpServletRequest request) {
if (!POST_METHOD.equalsIgnoreCase(request.getMethod() )) {
return false;
}
return FileUploadBase.isMultipartContent(new ServletRequestContext(request));
}
Is not a thing of vital importance, in fact just use the POST method intead of PUT works.. But I want to undertand why PUT is not taken into account!
Thank you for any reply Marco