What are the different methods of Uploading a file to S3 bucket using boto3?

0 votes
What are the different methods of Uploading a file to S3 bucket using boto3?
Nov 30, 2018 in AWS by Nitesh
• 2,920 points
823 views

1 answer to this question.

0 votes

There are three ways in which you can upload a file to amazon S3. 

1. Object Instance Versioning

s3_resource.Object('bucketname', 'filename').upload_file(Filename='filename')

or

first_object.upload_file('filename')

2. Bucket Instance Versioning

s3_resource.Bucket('bucketname').upload_file(
    Filename='filename', Key='filename')

3. Client Versioning

s3_resource.meta.client.upload_file(Filename='filename', Bucket='bucketname',Key='filename')

answered Nov 30, 2018 by Aniket

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,090 points
3,709 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
• 56,520 points
228 views
0 votes
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
• 56,520 points
448 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,560 points
301 views
0 votes
2 answers
–1 vote
1 answer

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,560 points
7,441 views