mirror of https://github.com/django/django.git
Fixed a bug in the way file uploads were constructed. The new behaviour
should emulate a form upload more accurately. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5c346840bb
commit
a4d773b580
|
@ -65,10 +65,7 @@ def encode_multipart(boundary, data):
|
|||
if isinstance(value, file):
|
||||
lines.extend([
|
||||
'--' + boundary,
|
||||
'Content-Disposition: form-data; name="%s"' % key,
|
||||
'',
|
||||
'--' + boundary,
|
||||
'Content-Disposition: form-data; name="%s_file"; filename="%s"' % (key, value.name),
|
||||
'Content-Disposition: form-data; name="%s"; filename="%s"' % (key, value.name),
|
||||
'Content-Type: application/octet-stream',
|
||||
'',
|
||||
value.read()
|
||||
|
@ -251,4 +248,4 @@ class Client:
|
|||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue