Skip to main content
Question

downloading and uploading files - python

  • May 22, 2025
  • 1 reply
  • 23 views

Forum|alt.badge.img

Hello, I am using Watson Studio notebook and I downloaded the box file by using the following instruction.

download_file = client.file(file_id).content()

Now I need to upload the downloaded file into a Cloud Object Storage bucket, yet I do not know the file path where the downloaded file is located in. 

May you help pls? Thanks in advance

1 reply

Forum|alt.badge.img

Hello, 

I believe you want to download the file into an output like this. 

 

file_id = '11111'

# Write the Box file contents to disk
output_file = open('file.pdf', 'wb')
client.file(file_id).download_to(output_file)