to simplify:
curl --location --request PUT 'https://myserver.com/upload' \
--form 'file=@/Users/myname/Desktop/bond.jpg' \
--form 'test=test'
It gets to my Django App:
class MyUploadView(APIView):
parser_classes = [FormParser, MultiPartParser]
def put(self, request, **kwargs):
print(request.FILES)
but gives out: <MultiValueDict: {}>
nothing I do work, file is always empty. when I use Content-Type: multipart/form-data
it doesn't work as well, and sometimes django
would complain there is no boundary
-- but any value there gives out the same error.
MY GOAL IS SIMPLE: all I want it to upload a file to django and save it to disk on the backend.
I cannot believe this i taking all day long with zero results and zero examples online that actually work.