'Handle encoded filenames per RFC6266. See also:
http://tools.ietf.org/html/rfc2231#section-4'

def get_encoded_filename(self, filename_parm):

    encoded_filename = force_text(filename_parm[u'filename*'])
    try:
        (charset, lang, filename) = encoded_filename.split(u"'", 2)
        filename = urlparse.unquote(filename)
    except (ValueError, LookupError):
        filename = force_text(filename_parm[u'filename'])
    return filename
