Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)
I am using the AWS SDK for python Boto3. And I want to create folders directly using it. Is there any template or sample code which I could use? Please reply to me.

1 Answer

0 votes
by (44.4k points)

Yes, there is. It is just 5 lines of code where one line is importing boto3.

import boto3

s3 = boto3.client('s3')

bucket_name = "bucket-name-here"

folder_name = "name/ofyour/folders"

s3.put_object(Bucket=bucket_name, Key=(folder_name+'/'))

In folder_name, provide all the folder names you want to add.

Hope this helps!

by (100 points)
thanks @kodee this is what I was looking for

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.7k questions

32.8k answers

500 comments

109k users

Browse Categories

...