﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13582	multiple files uploaded with same name are not iterable	anonymous	nobody	"I am uploading a sound file with multiple images files associated using curl like this:

{{{
curl -X POST http://localhost:8000/analysis/test_post/ -F ""file=@6.3gp"" -v -F ""image=@d1e98eee-f5af-41b1-9974-9d209816f2d3.jpg"" -F ""image=@gyoza.jpg""
}}}

and here is what I get if I put a breakpoint and play with an ipython shell:
{{{
In [1]: request.FILES
Out[1]: <MultiValueDict: {
	 u'image': [<InMemoryUploadedFile: d1e98eee-f5af-41b1-9974-9d209816f2d3.jpg (image/jpeg)>,
	            <InMemoryUploadedFile: gyoza.jpg (image/jpeg)>],
         u'file': [<InMemoryUploadedFile: 6.3gp (application/octet-stream)>]}>

In [2]: request.FILES.keys()
Out[2]: [u'image', u'file']

In [3]: request.FILES.values()
Out[3]:[<InMemoryUploadedFile: gyoza.jpg (image/jpeg)>,
	<InMemoryUploadedFile: 6.3gp (application/octet-stream)>]
		
In [4]: request.FILES['image']
Out[4]: <InMemoryUploadedFile: gyoza.jpg (image/jpeg)>
}}}

As you can see I only have one file when I query the dictionnary-like {{{request.POST}}} object hence I cannot iterate over it which is what I want to do.

Note that this ticket is similar to #12446 but I am using curl to do the upload as specified in their manual (at http://www.cs.sunysb.edu/documentation/curl/index.html):
{{{
To send two files in one post you can do it in two ways:
1. Send multiple files in a single ""field"" with a single field name:
curl -F ""pictures=@dog.gif,cat.gif""
2. Send two fields with two field names:
curl -F ""docpicture=@dog.gif"" -F ""catpicture=@cat.gif""
}}}
Both fail."		closed	File uploads/storage			invalid	multiple files POST		Unreviewed	0	0	0	0	0	0
