So i have been trying to upload a file to a method using DRF with no luck so far.
I was able to upload to a ModelViewSet
using (FormParser, MultiP
Any uploaded files should be available in request.FILES
, a dictionary keyed by the field that they was used when uploading. Once you have the file, it's a matter of handling it similar to any other uploaded file in Django.
If you can, I would use a second serializer that wraps the Multimedia
model so the image validation and saving can be done automatically through Django REST Framework. There is an ImageField that will automatically validate the image by Pillow
which you can use on the serializer.