def upload_file_to_slack(slack_connection, file_name, channel_name, timestamp):
    """
    Upload a file to Slack in a thread under the main message.
    All channel members will have access to the file.
    Only works for files <50MB.
    """
    try:
        file_response = slack_connection.files_upload(
            file=file_name,
            filename=file_name,
            title=file_name,
            channels=channel_name,
            thread_ts=timestamp)
        print(f'{file_name} successfully uploaded.')
    except Exception as e:
        print(e)
        file_response = None
        print('File failed to upload.')
    return file_response