title: How to save multiple file fields to django using jquery and Ajax
body: <p>I am trying to save multiple file fields to server. Field fields are dynamic, we can upload as many file as we want using add button. I dont wanted to use form submit or dropzone. Can anyone please help me how to do it.</p>
  
  <pre><code>    &lt;div class="row" id="point_of_interest"&gt;  
           &lt;div class="col-lg-4 "&gt;            
               &lt;label&gt;Point of Interest Name&lt;/label&gt;
               &lt;input type="text" name="point_of_interest_name"  class="form-control interest_name" &gt;
               &lt;label class="error"  style="color:red; display:none;"&gt;&lt;/label&gt;
           &lt;/div&gt;
          &lt;div class="col-lg-4 "&gt;            
               &lt;label&gt;Upload Image&lt;/label&gt;
               &lt;input  type="file" accept="image/*" name="point_of_interest_image[]" class="poi_img form-control" placeholder="Upload image" &gt;
          &lt;/div&gt;
          &lt;div class="col-lg-4 "&gt;            
              &lt;div class="form-group"&gt;
                   &lt;a class="fa fa-plus-circle fa-lg add_point_of_interest"  style="margin-top:33px;" &gt;&lt;/a&gt; 
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The above HTML is for dynamically adding form fields</p>
  
  <pre><code>    $('#point_of_interest').find('input[type=file]').each(function (index,val) {
  
          var city_image = $(this).prop(files)[0]; 
      console.log(city_image); 
      point_of_interest_image_list.push(city_image);
  
      });
  </code></pre>
  
  <p>The above jquery code is for collecting multiple objects</p>
  
  <pre><code>    @csrf_exempt
      def save_city_data(request):
      try:
         print '=====request========',request.POST
         print      '=====request========',request.FILES.getlist('point_of_interest_image_list')
  </code></pre>
  
  <p>Using above code I am getting list of all files</p>