def filename_ext(filename):
    """ Function that returns filename extension """
    # Taken from http://flask.pocoo.org/docs/1.0/patterns/fileuploads/

    return '.' in filename and filename.rsplit('.', 1)[1].lower()