On Mar 24, 2010, at 11:35 AM, emile wrote:
>
> Hi,
>
> I am using Jersey in conjunction with Apache file upload to upload
> file
> content. The method in my resource is a PUT since it involvs updation.
>
> ServletFileUpload.isMultipartContent(request) always returns false.
> However
> when the method was changed to POST it returns true. Not sure whats
> goin on.
>
See the source code:
http://www.docjar.com/html/api/org/apache/commons/fileupload/servlet/ServletFileUpload.java.html#61
66 public static final boolean isMultipartContent(
67 HttpServletRequest request) {
68 if
(!"post".equals(request.getMethod().toLowerCase())) {
69 return false;
70 }
71 String contentType = request.getContentType();
72 if (contentType == null) {
73 return false;
74 }
75 if (contentType.toLowerCase().startsWith(MULTIPART)) {
76 return true;
77 }
78 return false;
79 }
It restricts multipart forms to be used with POST requests.
Paul.