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

Matthew Runo commented on FILEUPLOAD-214:
-----------------------------------------

According to the HTTP RFC (http://www.ietf.org/rfc/rfc2616.txt), section 9.1.2 
"Idempotent Methods" GET, HEAD, PUT, and DELETE are all idempotent. This means 
that when designing an API, if you want to properly follow the spec, simply 
uploading a file (with no other effects) should be a PUT, since you can upload 
the same file over and over with no changes. 

POST implies that if you upload the same file twice, you'll end up with two 
different files on the server, or two entires in a database/etc. Both make 
sense in api design for different use cases, but only one works with 
commons-fileupload right now. 

                
> ServletFileUpload only accepts POST requests
> --------------------------------------------
>
>                 Key: FILEUPLOAD-214
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-214
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Spring 3.x
>            Reporter: Matthew Runo
>            Priority: Minor
>
> ServletFileUpload is hard coded to only accept POST requests. See 
> implementation of isMultipartContent. Since PUT (and other) requests might 
> also be used to upload files in REST apis, this restriction should be 
> removed. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to