Update/Upload User Profile Picture Hi, I want to upload and update a user's profile image with no luck, I tried various approaches non work, even the code in the documentation, the code returns "Parameter [image] value is invalid."Following is my code.# ----- views.py ----- #
class UpdateUserProfilePicture(APIView):
permission_classes = [IsAdminUser]
authentication_classes = [CustomeAuthentication]
def post(self, request, extensionId):
data = request.data
file_data = data.pop('image')
data["image"] = file_data
res = updateUserProfilePicture(extensionId, data)
return Response(res)# ----- api.py ----- #
def updateUserProfilePicture(extensionId, data):
platform, rcsdk = login()
imgType = Image.open(BytesIO(data["image"][0].read())).format.lower()
image = (data["image"][0].name, data["image"][0].read(), f'image/{imgType}')
builder = rcsdk.create_multipar