def extract_filename(content_disposition_header, default_filename=None):

    if not content_disposition_header:
        return default_filename
    value, params = cgi.parse_header(content_disposition_header)
    return params.get('filename', default_filename)
Extract a filename from an HTTP content-disposition header field.
dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/synapseclient/utils.py/extract_filename