Questo contenuto non è disponibile nella lingua selezionata.

Chapter 6. Downloading files from your bucket


To download a file from your bucket to your workbench, use the download_file() method.

Prerequisites

  • You have cloned the odh-doc-examples repository to your workbench.
  • You have opened the s3client_examples.ipynb file in your workbench.
  • You have installed Boto3 and configured an S3 client.

Procedure

  1. In the Jupyter notebook, locate the following instructions to download files from a bucket:

    #Download file from bucket
    #Replace the following values with your own:
    #<bucket_name>: The name of the bucket.
    #<object_name>: The name of the file to download. Must include full path to the file on the bucket.
    #<file_name>: The name of the file when downloaded.
    
    s3_client.download_file('<bucket_name>','<object_name>','<file_name>')
  2. Modify the code sample:

    1. Replace <bucket_name> with the name of the bucket that the file is located in…​ Replace <object_name> with the name of the file that you want to download.
    2. Replace <file_name> with the name and path that you want the file to be downloaded to, as shown in the example.

      s3_client.download_file('aqs086-image-registry',
                              'series35-image36-086.csv',
                              '\tmp\series35-image36-086.csv_old')
  3. Run the code cell.

Verification

  • The file that you downloaded is displayed in the path that you specified on your workbench.
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima