Chapter 6. Uploading files to available Amazon S3 buckets using notebook cells
You can upload files from your notebook server to an Amazon S3 bucket using the
- Configure an Amazon S3 client in a previous cell in the notebook. See Creating an Amazon S3 client using notebook cells for more information.
Define the following in a notebook cell:
The name of the file to upload. This must include the full local path to the file.
file_name = name_of_the_file_to_upload
The name of the bucket to upload the file to.
bucket_name = name_of_the_bucket
The full key to use to save the file to the bucket.
key = full_path_and_file_name
Upload the file, specifying the previous variables as arguments.
s3_client.upload_file(file_name, bucket_name, key)