Ticket #3211: allow_MHTML_upload_patch.r6660.diff

File allow_MHTML_upload_patch.r6660.diff, 1.3 KB (added by gt4329b, 8 years ago)
  • __init__.py

     
    112112            # or {'name': 'blah'} for POST fields
    113113            # We assume all uploaded files have a 'filename' set.
    114114            if 'filename' in name_dict:
    115                 assert type([]) != type(submessage.get_payload()), "Nested MIME messages are not supported"
     115                #assert type([]) != type(submessage.get_payload()), "Nested MIME messages are not supported"
     116                _payload = submessage.get_payload()
     117                if type([]) == type(submessage.get_payload()):
     118                    _payload = submessage.get_payload(0).as_string()
    116119                if not name_dict['filename'].strip():
    117120                    continue
    118121                # IE submits the full path, so trim everything but the basename.
     
    123126                FILES.appendlist(name_dict['name'], FileDict({
    124127                    'filename': filename,
    125128                    'content-type': 'Content-Type' in submessage and submessage['Content-Type'] or None,
    126                     'content': submessage.get_payload(),
     129                    'content': _payload,
    127130                }))
    128131            else:
    129132                POST.appendlist(name_dict['name'], submessage.get_payload())
Back to Top