#12446: multipart/mixed in multipart/form-data
-------------------------------------------+--------------------------------
Reporter: ssssssssssss | Owner:
Status: new | Milestone:
Component: File uploads/storage | Version: 1.1
Resolution: | Keywords: multipart/mixed
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Comment (by ramiro):
I've tested apollo13's sample code as is and with a small tweak (adding a
text field to the form to see if this forces the browser to send a
multipart/mixed nested container inside the multipart/form-data) with
Chrome 6:
{{{
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def test_view(request):
if request.method == 'POST':
#f = open('post_data.txt', 'w')
#print >>f, request.META['CONTENT_TYPE']
#print >>f, request.raw_post_data
#f.close()
for i in request.FILES.getlist('test'):
print i.name
return HttpResponse('''<html><body>
<form action="." method="post" enctype="multipart/form-data">
<input type="text" id="proj-search" name="q" size="10" accesskey="f"
value="">
<input type="file" name="test" id="test" multiple="">
<input type="submit">
</form>
</body></html>''')
}}}
And things work correctly (all uploaded files are made available). But the
browser isn't sending a `multipart/mixed` part (activate the commented out
lines to get it dumped to a file).
Can't currently test with Firefox > 3.5 so I can't verify if Firefox
behavior is different from Chrome.
Can any of the interested users (the OP, wanliyou, Ciantic td123) please
clarify if `multipart/mixed` support is critical to the implementation of
multi-file upload parsing?
--
Ticket URL: <http://code.djangoproject.com/ticket/12446#comment:11>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.