[jira] [Created] (FILEUPLOAD-197) ServletFileUpload isMultipartContent method does not support HTTP PUT

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FILEUPLOAD-197) ServletFileUpload isMultipartContent method does not support HTTP PUT

Sebb (Jira)
ServletFileUpload isMultipartContent method does not support HTTP PUT
---------------------------------------------------------------------

                 Key: FILEUPLOAD-197
                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-197
             Project: Commons FileUpload
          Issue Type: Bug
    Affects Versions: 1.2.1
            Reporter: David Wolverton


This method explicitly checks for method POST. I believe the PUT method can also have multipart requests, and there may be others. In our case we are receiving rest calls using Spring Framework's CommonsMultipartResolver which in turn uses this method of the Commons FileUpload library.

Here is the offending code...

if (!"post".equals(request.getMethod().toLowerCase())) {
    return false;
}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (FILEUPLOAD-197) ServletFileUpload isMultipartContent method does not support HTTP PUT

Sebb (Jira)

    [ https://issues.apache.org/jira/browse/FILEUPLOAD-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065509#comment-13065509 ]

Jochen Wiedmann commented on FILEUPLOAD-197:
--------------------------------------------

I have never heard of something like that and I'd clearly read section 9.6 in http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html different:

    The PUT method requests that the enclosed entity be stored under the supplied Request-URI.

*The* enclosed entity. Not a multipart request with various entities.

Unless you can supply a a clear and convincing citation that shows me I am wrong I intend to close this isue as INVALID.


> ServletFileUpload isMultipartContent method does not support HTTP PUT
> ---------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-197
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-197
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: David Wolverton
>
> This method explicitly checks for method POST. I believe the PUT method can also have multipart requests, and there may be others. In our case we are receiving rest calls using Spring Framework's CommonsMultipartResolver which in turn uses this method of the Commons FileUpload library.
> Here is the offending code...
> if (!"post".equals(request.getMethod().toLowerCase())) {
>     return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (FILEUPLOAD-197) ServletFileUpload isMultipartContent method does not support HTTP PUT

Sebb (Jira)
In reply to this post by Sebb (Jira)

    [ https://issues.apache.org/jira/browse/FILEUPLOAD-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066003#comment-13066003 ]

David Wolverton commented on FILEUPLOAD-197:
--------------------------------------------

I see your concern. I have to admit I do not have in-depth knowledge in this area. However, I don't see that the document you mentioned makes a clear case that POST can accept multipart/* MIME types while PUT cannot.

The document says the same for the POST method:

The POST method is used to request that the origin server accept _the entity_ enclosed

I guess from a practical standpoint, it at least is something that CURL allows and that we have use for.

Our use-case is this. We ware posting content to a CMS. The content consists of a set of meta-data properties as well as a binary content (such as an image or xml or html document). We would like build a REST web service API that allows us to include all of this is one call, just like posting a form with an upload element. According to the spec, PUT is the appropriate method for updating an entity. In our case the entity is made up of parts: several properties and a content.



> ServletFileUpload isMultipartContent method does not support HTTP PUT
> ---------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-197
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-197
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: David Wolverton
>
> This method explicitly checks for method POST. I believe the PUT method can also have multipart requests, and there may be others. In our case we are receiving rest calls using Spring Framework's CommonsMultipartResolver which in turn uses this method of the Commons FileUpload library.
> Here is the offending code...
> if (!"post".equals(request.getMethod().toLowerCase())) {
>     return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira