In Django REST Framework (DRF), how do I support de-Serializing base64
encoded binary data?
I have a model:
class MyModel(Model):
data = models.FileField(...)
and I want to be able to send this data as base64 encoded rather than having to multi-part form data or a "File Upload". Looking at the Parsers
, only FileUploadParser
and MultiPartParser
seem to parse out the files.
I would like to be able to send this data in something like JSON (ie send the binary data in the data
rather than the files
:
{
'data':'...'
}