title: Django DRF Unable to send PUT request with Image Field
body: <p>I have a form in React through which I am sending some data which includes an ImageField. I am able to perform a POST request and the data is being sent to Django backend successfully. However, when I try to modify the data I get employee_image: `</p>
  <blockquote>
  <p>[&quot;The submitted data was not a file. Check the encoding type on the
  form.&quot;]</p>
  </blockquote>
  <p>This is the data coming up on GET request:</p>
  <blockquote>
  <p>[
  {
  &quot;id&quot;: 2,
  &quot;product_name&quot;: &quot;XYZ&quot;,
  &quot;product_description&quot;: &quot;XYZ&quot;,
  &quot;product_price&quot;: &quot;12.00&quot;,
  &quot;product_unit_weight&quot;: &quot;120.00&quot;,
  &quot;product_unit_weight_units&quot;: &quot;GM&quot;,
  &quot;product_type&quot;: &quot;CPG&quot;,
  &quot;product_image&quot;: &quot;http://192.168.29.135:8000/media/product_images/xyz.png&quot;
  },</p>
  </blockquote>
  <p>This is my models.py file:</p>
  <pre><code>class ProductViewSet(viewsets.ModelViewSet):
      queryset = Product.objects.all()
      serializer_class = ProductSerializer
  
      def post(self, request, *args, **kwargs):
          product_name = request.data['product_name']
          product_description = request.data['product_description']
          product_price = request.data['product_price']
          product_unit_weight = request.data['product_unit_weight']
          product_unit_weight_units = request.data['product_unit_weight_units']
          product_type = request.data['product_type']
          product_image = request.data['product_image']
          Product.objects.create(product_name=product_name, product_description=product_description, product_price=product_price, product_unit_weight=product_unit_weight, product_unit_weight_units=product_unit_weight_units, product_type=product_type, product_image=product_image)
          return Response({'message':'Product created successfully'}, status=200)
  
      def update(self, request, *args, **kwargs):
          print('Put method running')
          pk = self.kwargs.get('pk')
          product = get_object_or_404(Product.objects.all(), pk=pk)
          print(product)
          if (product.product_image.startswith('http')):
              img_name = dataDict[&quot;product_image&quot;].split(&quot;/&quot;)[-1]
              product_img_temp = ContentFile(request.get(dataDict[&quot;product_image&quot;]).content, name=img_name)
              dataDict['product_img'] = product_img_temp
          serializer = ProductSerializer(product, data=request.data)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  <p>I tried following this <a href="https://stackoverflow.com/questions/63382308/django-drf-put-request-imagefield">response</a> and edited my models.py with the update() as shown above. But the error that I get is:</p>
  <blockquote>
  <p>'Product' object has no attribute 'data'</p>
  </blockquote>
  <p>Also, When I am printing the product in the update() method, I am getting only the product name printed and not the rest of the fields. I am unable to understand why I am getting this issue. Any help would be much appreciated. Thanks in advance.</p>
  <p>`</p>