def get_filename_pref(file_name):
    """Splits the filename apart from the path
    and the extension. This is used as part of
    the identifier for individual file uploads."""
    while '/' in file_name:
        file_name = file_name.split('/', maxsplit=1)[1]
    while '\\' in file_name:
        file_name = file_name.split('\\', maxsplit=1)[1]
    file_name_pref = file_name.split('.')[0]
    return file_name_pref