“if an uploaded file is too large, Django will write the uploaded file to a temporary file stored in your system’s temporary directory. On a Unix-like platform this means you can expect Django to generate a file called something like /tmp/tmpzfp6I6.upload. If an upload is large enough, you can watch this file grow in size as Django streams the data onto disk.”
This is taken from Django’s documentation.
My question is how long will this file be retained in memory? and will each upload have a unique name regardless if the same file is uploaded twice?
Are you talking about the temporary file on the filesystem? In that case, on a Unix platform, usually until you reboot. If you’re talking about uploaded files in RAM, it probably stays in there at least until the request/response cycle is done. But that shouldn’t really matter to you, you’ll have to handle the uploaded file in the response processing code anyways. Otherwise, you won’t have any reference to it anymore.
Yes.