import csv


def sniff_header_from_content(content):
    """
    use csv sniffer to check if content has a header 
    including column names

    keywords:
    content -- content of uploaded file
    """

    content.seek(0)
    sniffer = csv.Sniffer()
    try:
        has_header = sniffer.has_header(content.read(2048).decode('utf8'))
    except UnicodeDecodeError:
        has_header = sniffer.has_header(content.read(2048).decode('latin1'))
    return has_header