Based on the documentation the out-of-the-box support for file uploads is only available for the HTTP POST method. I suggest this is extended also for the PUT method.
Reasons: When building a REST API interface one uses the PUT method for modification/updating resources. The “resource” might include some data as well as a file. While file uploads with the PUT method are generally possible the direct support in Django is missing and this might complicate building a REST interface in a consistent way.
My understanding is this could hardly break some existing functionality and the implementation would not be that complicated.
This has been requested before, see the comments in this ticket plus the linked mailing list threads: #12635 (Process HTTP PUT into request.FILES and request.PUT as done for POST) – Django
There’s also though a GSoC project to address #21442 (Configurable request parsing.) – Django this year. That should allow a parsed
request.data for all request methods. (So if configured parsers include multipart file parsing, that this should well be supported at that point.)
Hi, thanks for responding.
It looks I should have been more careful searching the forum not to duplicate topics, sorry for that. While I get the reasons for refusing the suggestion in the past I do not completely agree. I still believe that sending binary data with the
Anyway, thanks once more for your attention,
Hopefully the GSoC project should open the gate here.