logo-MindMajix
PostAWSAWS
k
kavya A

Posted on 25th July 2024|23 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?

1 answers
Answers
P
Aryan Sharma

Posted on 25th July 2024| views

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
Name
Course *
Email *
Phone Number