Post

AWSAWS

k
kavya A

Posted on 20th April 2024|21 views

0
votes

What Is The Way To Read Files From S3 Bucking Using Boto 3?

In Python script, it downloads files from S3 to Blank_file.txt to read and write the content. How do I do it the same way when the data is in the AWS Lambda Function?

Answers
P
Aryan Sharma

Posted on 20th April 2024

Use the below mentioned code:

 

import boto3

s3 = boto3.resource('s3')

obj = s3.Object(bucketname, itemname)

body = obj.get()['Body'].read()

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos