title: Serialize multiple InMemoryUploadedFile using ListField : Django REST Framework
body: <p>How can I serialize multiple <a href="https://docs.djangoproject.com/en/2.2/ref/files/uploads/#django.core.files.uploadedfile.InMemoryUploadedFile" rel="nofollow noreferrer"><strong><code>InMemoryUploadedFile</code></strong></a> using <a href="https://www.django-rest-framework.org/api-guide/fields/#listfield" rel="nofollow noreferrer"><strong><code>serializers.ListField()</code></strong></a> ??</p>
  
  <hr>
  
  <p><strong>code snippet</strong><br></p>
  
  <pre><code>#views.py
  @api_view(['POST', 'GET'])
  def create_post(request):
      if request.method == 'POST':
          altered_request_data = request.data.copy()
          in_memory_upload_files_list = [value for value in request.FILES.values()]
          altered_request_data['files'] = in_memory_upload_files_list
          serializer = PostSerializer(data=altered_request_data)
          serializer.is_valid(raise_exception=True)
          serializer.save()
          return Response(data=serializer.data, status=201)
      else:
          qs = Post.objects.all()
          serializer = PostSerializer(qs, many=True)
          return Response(serializer.data)
  
  #serilizers.py
  class PostSerializer(serializers.ModelSerializer):
      files = serializers.ListField(child=serializers.FileField(), write_only=True)
  
      class Meta:
          fields = '__all__'
          model = Post
  </code></pre>
  
  <p><strong>current response</strong></p>
  
  <pre><code>{
      "files": {
          "0": [
              "The submitted data was not a file. Check the encoding type on the form."
          ]
      }
  }
  </code></pre>