Fixed #32004 -- Clarified docs for when request.FILES is set.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
This commit is contained in:
János Roden 2020-09-16 10:22:38 +02:00 committed by Carlton Gibson
parent 75d7af43c1
commit 9e4b1ad33e
1 changed files with 3 additions and 3 deletions

View File

@ -38,9 +38,9 @@ subclass) in the form. So the data from the above form would
be accessible as ``request.FILES['file']``. be accessible as ``request.FILES['file']``.
Note that :attr:`request.FILES <django.http.HttpRequest.FILES>` will only Note that :attr:`request.FILES <django.http.HttpRequest.FILES>` will only
contain data if the request method was ``POST`` and the ``<form>`` that posted contain data if the request method was ``POST``, at least one file field was
the request has the attribute ``enctype="multipart/form-data"``. Otherwise, actually posted, and the ``<form>`` that posted the request has the attribute
``request.FILES`` will be empty. ``enctype="multipart/form-data"``. Otherwise, ``request.FILES`` will be empty.
Most of the time, you'll pass the file data from ``request`` into the form as Most of the time, you'll pass the file data from ``request`` into the form as
described in :ref:`binding-uploaded-files`. This would look something like: described in :ref:`binding-uploaded-files`. This would look something like: