[Django]-How to stream a file in a request?

0👍

Probably, this is no longer relevant, but I will share some information that I found in the documentation.

By default, if an uploaded file is smaller than 2.5 megabytes, Django
will hold the entire contents of the upload in memory. This means that
saving the file involves only a read from memory and a write to disk
and thus is very fast. However, if an uploaded file is too large,
Django will write the uploaded file to a temporary file stored in your
system’s temporary directory.

This way, there is no need to create a streaming file upload. Rather, the solution might be to handle (read) the loaded using a buffer.

Leave a comment