upload_object#

ltdconveyor.s3.upload_object(bucket_path, bucket, content='', metadata=None, acl=None, cache_control=None, content_type=None)#

Upload an arbitrary object to an S3 bucket.

Parameters:
  • bucket_path (str) – Destination path (also known as the key name) of the file in the S3 bucket.

  • content (str or bytes, optional) – Object content.

  • bucket (boto3 Bucket instance) – S3 bucket.

  • metadata (dict, optional) – Header metadata values. These keys will appear in headers as x-amz-meta-*.

  • acl (str, optional) – A pre-canned access control list. See https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl Default is None, meaning that no ACL is applied to the object.

  • cache_control (str, optional) – The cache-control header value. For example, 'max-age=31536000'.

  • content_type (str, optional) – The object’s content type (such as text/html). If left unset, no MIME type is passed to boto3 (which defaults to binary/octet-stream).

Return type:

None