When I submit to Django a multiple files upload form
<input type="file" name="files" multiple />
I get a sensible result in request.FILES
:
(MultiValueDict: {u'files': [(InMemoryUploadedFile: 0202.jpg (image/jpeg)), (InMemoryUploadedFile: 0203.jpg (image/jpeg))]})
But then my confusion starts. I thought request.FILES['files']
would contain a couple of files (appears to be a list), but it shows only
0203.jpg
No InMemoryUploadedFile
part and more importantly: only the last file!
Looping through request.FILES
with .iteritems()
only goes over that one file too, request.FILES['files']
is distinctly uniterable; the below code actually froze up the console and made it beep endlessly:
for v in request.FILES['files']:
print v
print type(v)
So... Is any of this this normal? What am I doing wrong?
As I'm starting to think this may be a bug: I'm using Django 1.4.2 with Python 2.7 on Windows 7.