Ticket #7143: client_upload_filename.patch

File client_upload_filename.patch, 836 bytes (added by cpinto, 17 years ago)
  • django/test/client.py

     
    11import urllib
    2 import sys
     2import sys,os
    33from cStringIO import StringIO
    44from django.conf import settings
    55from django.contrib.auth import authenticate, login
     
    6767        if isinstance(value, file):
    6868            lines.extend([
    6969                '--' + 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]),
    7171                'Content-Type: application/octet-stream',
    7272                '',
    7373                value.read()
Back to Top