How to upload a file in a particular folder in S3 using Python boto3

+1 vote
How to upload a file in a particular folder in S3 using Python boto3?
Nov 30, 2018 in AWS by Nitesh
• 3,080 points
15,488 views

1 answer to this question.

+1 vote

There is a particular format that works fine with python 3.x

Here is the way you can implement it.

import boto3
s3 = boto3.resource('s3')
s3.Bucket('aniketbucketpython').upload_file('C:\\Users\\aniket\\Desktop\\testdb1.json','%s/%s' %('aniketfolder2','testdb.json'))


Hope this is helpful!

To know more join Master in Python programming course today.

Thanks!

answered Nov 30, 2018 by Aniket

Related Questions In AWS

0 votes
0 answers

How to upload a file in to aws s3 by using programmatically??

Sep 13, 2019 in AWS by anonymous

closed Sep 16, 2019 by Kalgi 3,897 views
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,170 points
19,855 views
+1 vote
2 answers

How to read a csv file stored in Amazon S3 using csv.DictReader

The code would be something like this: import ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
54,416 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
5,958 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,204 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,868 views
0 votes
2 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP