def _get_filename_from_content_disposition(content_disposition):
    """
    Determine an output filename based on the `Content-Disposition` header.
    """
    params = value, params = cgi.parse_header(content_disposition)

    if "filename" in params:
        filename = params["filename"]
        return _safe_filename(filename)

    return None

    Determine an output filename based on the `Content-Disposition` header.
    
apistar/client/decoders.py