I have this simple script in Ruby to upload a file on S3 I got from AWS documentation:
def object_uploaded?(s3_resource, bucket_name, object_key, file_path)