Object / Action / upload_file

upload_file#

S3.Object.upload_file(Filename, ExtraArgs=None, Callback=None, Config=None)#

Upload a file to an S3 object.

Usage:

import ibm_boto3
s3 = ibm_boto3.resource('s3')
s3.Object('mybucket', 'hello.txt').upload_file('/tmp/hello.txt')

Similar behavior as S3Transfer’s upload_file() method, except that parameters are capitalized. Detailed examples can be found at S3Transfer’s Usage.

Parameters:
  • Filename (str) – The path to the file to upload.

  • ExtraArgs (dict) – Extra arguments that may be passed to the client operation. For allowed upload arguments see ibm_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 (ibm_boto3.s3.transfer.TransferConfig) – The transfer configuration to be used when performing the transfer.