title: Django: can we alter filefield such that when a file is selected, it immediately gets uploaded
body: <p>I was just wondering: Will it be possible to alter the File Field such that when a file is selected, it immediately gets uploaded, without the means of additional button?</p>
  
  <p>Assuming that I imported everything from .models, .forms, urls.py, etc successfully,</p>
  
  <p>Codes in <strong>models.py</strong>:</p>
  
  <pre><code>class data(models.Model):
      Datas = models.FileField(upload_to='datas/upload')
  </code></pre>
  
  <p>Codes in <strong>forms.py</strong>:</p>
  
  <pre><code>class form1(forms.ModelForm):
      class Meta:
          model = data
          fields = ('Datas',)
  </code></pre>
  
  <p>Codes in <strong>views.py</strong>:</p>
  
  <pre><code>def upload(request):
      if request.method == 'POST' and 'btnform1' in request.POST:
          newform1 = form1(request.POST, request.FILES)
          if newform1.is_valid():
              newform1.save()
              return redirect('list')
  </code></pre>
  
  <p>Codes in <strong>upload.html</strong>:</p>
  
  <pre><code>&lt;h2&gt;Data&lt;/h2&gt;
       &lt;form method="post" enctype="multipart/form-data"&gt; {% csrf_token %}
       {{newform1.as_p}}
  &lt;!--        &lt;button type="submit" class="btn btn-primary" name="btnform1"&gt;Upload Data&lt;/button&gt;--&gt;
       &lt;/form&gt;
  </code></pre>
  
  <p>Can anyone guide me and possibly give a solution on how to do it if it is even possible? Thank you.</p>