During file uploads, the actual file data is stored in request.FILES. Each entry in this dictionary is an
UploadedFile object (or a subclass) – a simple wrapper around an uploaded
file. You’ll usually use one of these methods to access the uploaded content:

Read the entire uploaded data from the file. Be careful with this method:
if the uploaded file is huge it can overwhelm your system if you try to
read it into memory. You’ll probably want to use chunks() instead; see
below.

The content-type header uploaded with the file (e.g. text/plain
or application/pdf). Like any data supplied by the user, you
shouldn’t trust that the uploaded file is actually this type. You’ll still
need to validate that the file contains the content that the content-type
header claims – “trust but verify.”

A dictionary containing extra parameters passed to the content-type
header. This is typically provided by services, such as Google App Engine,
that intercept and handle file uploads on your behalf. As a result your
handler may not receive the uploaded file content, but instead a URL or
other pointer to the file. (see RFC 2388 section 5.3).

The data you return will get fed into the subsequent upload handlers’
receive_data_chunk methods. In this way, one handler can be a
“filter” for other handlers.

Return None from receive_data_chunk to short-circuit remaining
upload handlers from getting this chunk. This is useful if you’re
storing the uploaded data yourself and don’t want future handlers to
store a copy of the data.

If you raise a StopUpload or a SkipFile exception, the upload
will abort or the file will be completely skipped.

The handler should return an UploadedFile object that will be stored
in request.FILES. Handlers may also return None to indicate that
the UploadedFile object should come from subsequent upload handlers.

Size, in bytes, of the “chunks” Django should store into memory and feed
into the handler. That is, this attribute controls the size of chunks
fed into FileUploadHandler.receive_data_chunk.

For maximum performance the chunk sizes should be divisible by 4 and
should not exceed 2 GB (231 bytes) in size. When there are
multiple chunk sizes provided by multiple handlers, Django will use the
smallest chunk size defined by any handler.