Upload file if contains certain name

This is not the best solution, but it can be considered as a starting point

add_filter('sanitize_file_name', 'filter_function_name_11', 10, 2);

function filter_function_name_11($filename, $filename_raw) {  
    $pos = strripos($filename, 'example');
    if ($pos === false) {
       wp_die();
    } else {
        return $filename;
    }
}

error code: 523