S3 / Client / upload_file
upload_file#
- S3.Client.upload_file(Filename, Bucket, Key, ExtraArgs=None, Callback=None, Config=None)#
Upload a file to an S3 object.
Usage:
import boto3 s3 = boto3.client('s3') s3.upload_file('/tmp/hello.txt', 'mybucket', 'hello.txt')
Similar behavior as S3Transfer’s upload_file() method, except that argument names are capitalized. Detailed examples can be found at S3Transfer’s Usage.
- Parameters:
Filename (str) – The path to the file to upload.
Bucket (str) – The name of the bucket to upload to.
Key (str) – The name of the key to upload to.
ExtraArgs (dict) – Extra arguments that may be passed to the client operation. For allowed upload arguments see boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS.
Callback (function) – A method which takes a number of bytes transferred to be periodically called during the upload.
Config (boto3.s3.transfer.TransferConfig) – The transfer configuration to be used when performing the transfer.