Django Form Upload Files no data in request.FILES
<p>I am trying to store files that are uploaded from a django form. I upload the files in a report form and I would like to store the files on my server so I can access them later.</p>

<p>My Model:</p>

<pre><code>class Report(models.Model):
    author = models.ForeignKey(User, null=True)
    date = models.DateTimeField(auto_now_add=True)
    description = models.CharField(max_length=128)
    content = models.TextField()
    security = models.BooleanField(default=False)
</code></pre>

<p>My Form:</p>

<pre><code>class ReportForm(forms.ModelForm):
    description = forms.CharField(max_length=128)
    content = forms.TextInput()
    security = forms.BooleanField(required=False, initial=False, label="Private")
    files = forms.FileField(required=False)
    class Meta:
        model = Report
        fields = ('description','content','security','files',)
</code></pre>

<p>My View:</p>

<pre><code>def index(request):
    report_list=Report.objects.all()
    report_form=ReportForm(request.POST, request.FILES)
    if report_form.is_valid():
        report = report_form.save()
        report.author = request.user
        report.save()
        for count, x in enumerate(request.FILES.getlist("files")):
            with open(settings.MEDIA_ROOT, 'wb+') as destination:
                for chunk in x.chunks():
                    destination.write(chunk)
    context_dict = {'Reports' : report_list, 'Report_Form' : report_form}
    return render(request, 'index.html', context_dict)
</code></pre>

<p>My HTML:</p>

<pre><code>&lt;form id="report_form", method="post",action="/myapplication/",enctype="multipart/form-data"&gt;
        &lt;h3&gt;New Report:&lt;/h3&gt;
        {% csrf_token %}

        &lt;label for="id_description"&gt;Description:&lt;/label&gt;
        &lt;input class="form-control" id="id_description" maxlength="128" name="description" type="text"/&gt;
        &lt;label for="id_content"&gt;Content:&lt;/label&gt;
        &lt;input class="form-control" id="id_content" maxlength="2000" name="content" type="text"/&gt;
        &lt;label for="id_files"&gt;Files:&lt;/label&gt;
        &lt;input type="file" name="files" multiple&gt;
        &lt;label for="id_security"&gt;Security:&lt;/label&gt;
        Public &lt;input type="radio" id="id_security" name="security" value="False" checked&gt;
        Private &lt;input type="radio" id="id_security" name="security" value="True"&gt;
        &lt;br&gt;
        &lt;input class="btn btn-default" type="submit" name="Submit" value="Submit"/&gt;
        &lt;/form&gt;
</code></pre>

<p>Why can't I find the uploaded files in request.FILES? </p>