def getFileName(Url):
    """
    Get the filename from the specified URI or path.
    """
    name = str(Url)
    if 'http' and '?' in name:
        i = name.find('?')
        name = name[:i]
    if "/" in name:
        parts = name.split("/")
        return parts[-1]
    return name