[BangPypers] Question regarding memory of uploaded files in Django

Pranjal Mittal pranjal.mittal.ece10 at iitbhu.ac.in
Mon Dec 30 08:05:27 CET 2013


I had a question regarding how *InMemoryUploadedFiles* work in Django.
I posted the question in Stackoverflow. Haven't got a good answer yet.

Any one has a clue on how InMemoryUploadedFile(s) work in Django? If its a
file like object, or a file handle then is it really "in memory" ie. If I
upload a file of larger size then is the InMemoryUploadedFile object also
of a greater size or is it independent of that.

*To elaborate:*

AFAIK, when you open a file in Python, it returns a handle to the file
which takes the same memory irrespective of the size of the file being
opened. It is when you peform the *read()* operation, that the file is
really read into the memory. *InMemoryUploadedFile* type does have a read()
method; So does that make InMemoryUploadedFile a file handle itself, which
is independent of the uploaded file size?

- Pranjal

B.Tech. 2014
Indian Institute of Technology, BHU,
Varanasi, 221005
Uttar Pradesh,

More information about the BangPypers mailing list