How to download a file from S3 buckets using boto3?

0 votes

Hi Guys,

I am new to the S3 bucket. I want to download files from a specific bucket using boto3. How can I do that?

Oct 7 in AWS by akhtar
• 33,470 points
148 views

1 answer to this question.

0 votes

Hi@akhtar,

Boto3 supports upload_file() and download_file() APIs to store and retrieve files to and from your local file system to S3. 

import boto3
s3 = boto3.client('s3')
s3.download_file(Bucket='bucket_name',key='abc.txt',Filename='abc.txt')
answered Oct 7 by MD
• 79,390 points

Related Questions In AWS

0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,150 points
10,373 views
0 votes
1 answer
0 votes
1 answer

How can I return XML from boto calls?

I don't think there's an officially supported ...READ MORE

answered Jul 20, 2018 in AWS by Cloud gunner
• 4,650 points
402 views
+1 vote
1 answer