Search

Chapter 6. Uploading files to available Amazon S3 buckets using notebook cells

download PDF

You can upload files from your notebook server to an Amazon S3 bucket by using the upload_file method.

Prerequisites

Procedure

  1. Define the following details in a notebook cell:

    1. The name of the file to upload. This must include the full local path to the file. Replace <name_of_the_file_to_upload> with your own value.

      file_name = '<name_of_the_file_to_upload>'
    2. The name of the bucket to upload the file to. Replace <name_of_the_bucket> with your own value.

      bucket_name = '<name_of_the_bucket>'
    3. The full key to use to save the file to the bucket. Replace <full_path_and_file_name> with your own value.

      key = '<full_path_and_file_name>'
  2. Upload the file, specifying the previous variables as arguments.

    s3_client.upload_file(file_name, bucket_name, key)
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.