Ticket #15879: multipart_file_with_emptry_string_name.patch

File multipart_file_with_emptry_string_name.patch, 951 bytes (added by j@…, 14 years ago)

setting file_name to None instead of default value also works. with this patch django is able to handle Blob FormData send by Firefox 4.0

  • django/http/multipartparser.py

     
    163163                elif item_type == FILE:
    164164                    # This is a file, use the handler...
    165165                    file_name = disposition.get('filename')
    166                     if not file_name:
    167                         continue
     166                    if file_name == '':
     167                        file_name = None
    168168                    file_name = force_unicode(file_name, encoding, errors='replace')
    169169                    file_name = self.IE_sanitize(unescape_entities(file_name))
    170170
     
    586586
    587587        if name == 'content-disposition':
    588588            TYPE = FIELD
    589             if params.get('filename'):
     589            if 'filename' in params:
    590590                TYPE = FILE
    591591
    592592        outdict[name] = value, params
Back to Top