Ticket #7143: client_upload_filename.patch
File client_upload_filename.patch, 836 bytes (added by , 17 years ago) |
---|
-
django/test/client.py
1 1 import urllib 2 import sys 2 import sys,os 3 3 from cStringIO import StringIO 4 4 from django.conf import settings 5 5 from django.contrib.auth import authenticate, login … … 67 67 if isinstance(value, file): 68 68 lines.extend([ 69 69 '--' + boundary, 70 'Content-Disposition: form-data; name="%s"; filename="%s"' % (to_str(key), to_str(value.name) ),70 'Content-Disposition: form-data; name="%s"; filename="%s"' % (to_str(key), to_str(value.name).rsplit(os.path.sep,1)[-1]), 71 71 'Content-Type: application/octet-stream', 72 72 '', 73 73 value.read()