S3Client.upload_part
rboto-s3==0.4.0 · Service index · Types
Model summary (excerpt): Uploads a part in a multipart upload. In this operation, you provide new data as a part of an object in your request. However, you have an option to specify your existing Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you use the UploadPartCopy operation. You must initiate a multipart upload (see CreateMultipartUpload ) before you...
Install and imports
from rboto import S3Client
from collections.abc import AsyncIterator
from rboto_s3.types import (
ChecksumAlgorithm,
RequestPayer,
UploadPartOutput,
)
Signature
async def upload_part(
*,
bucket: str,
key: str,
part_number: int,
upload_id: str,
body: bytes | _FileBody | AsyncIterator[bytes] | None = None,
content_length: int | None = None,
content_md5: str | None = None,
checksum_algorithm: ChecksumAlgorithm | None = None,
checksum_crc32: str | None = None,
checksum_crc32_c: str | None = None,
checksum_crc64_nvme: str | None = None,
checksum_sha1: str | None = None,
checksum_sha256: str | None = None,
checksum_sha512: str | None = None,
checksum_md5: str | None = None,
checksum_xxhash64: str | None = None,
checksum_xxhash3: str | None = None,
checksum_xxhash128: str | None = None,
sse_customer_algorithm: str | None = None,
sse_customer_key: str | None = None,
sse_customer_key_md5: str | None = None,
request_payer: RequestPayer | None = None,
expected_bucket_owner: str | None = None,
) -> UploadPartOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
bucket |
Yes | The name of the bucket to which the multipart upload was initiated. Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format Bucket-name .s3express- zone-id . region-code .amazonaws.com . Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone).... |
key |
Yes | Object key for which the multipart upload was initiated. |
part_number |
Yes | Part number of part being uploaded. This is a positive integer between 1 and 10,000. |
upload_id |
Yes | Upload ID identifying the multipart upload whose part is being uploaded. |
body |
No | Object data. |
content_length |
No | Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. |
content_md5 |
No | The Base64 encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified. This functionality is not supported for directory buckets. |
checksum_algorithm |
No | Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request . For more information, see Checking... |
checksum_crc32 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_crc32_c |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_crc64_nvme |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit CRC64NVME checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_sha1 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit SHA1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_sha256 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit SHA256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_sha512 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 512-bit SHA512 digest of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_md5 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit MD5 digest of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_xxhash64 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit XXHASH64 checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_xxhash3 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit XXHASH3 checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
checksum_xxhash128 |
No | This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit XXHASH128 checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide . |
sse_customer_algorithm |
No | Specifies the algorithm to use when encrypting the object (for example, AES256). This functionality is not supported for directory buckets. |
sse_customer_key |
No | Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header . This must be the same encryption key specified in the initiate... |
sse_customer_key_md5 |
No | Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. This functionality is not supported for directory buckets. |
request_payer |
No | |
expected_bucket_owner |
No | The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied). |
Output
UploadPartOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
server_side_encryption |
ServerSideEncryptionOutput | None |
Always present | ServerSideEncryptionOutput |
e_tag |
str | None |
Always present | — |
checksum_crc32 |
str | None |
Always present | — |
checksum_crc32_c |
str | None |
Always present | — |
checksum_crc64_nvme |
str | None |
Always present | — |
checksum_sha1 |
str | None |
Always present | — |
checksum_sha256 |
str | None |
Always present | — |
checksum_sha512 |
str | None |
Always present | — |
checksum_md5 |
str | None |
Always present | — |
checksum_xxhash64 |
str | None |
Always present | — |
checksum_xxhash3 |
str | None |
Always present | — |
checksum_xxhash128 |
str | None |
Always present | — |
sse_customer_algorithm |
str | None |
Always present | — |
sse_customer_key_md5 |
str | None |
Always present | — |
ssekms_key_id |
str | None |
Always present | — |
bucket_key_enabled |
bool | None |
Always present | — |
request_charged |
RequestChargedOutput | None |
Always present | RequestChargedOutput |
version_id |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
ChecksumAlgorithm, RequestPayer, UploadPartOutput
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Input event streams accept the declared AsyncIterator of typed events.
Request byte bodies use bytes; they do not accept file objects or iterators.
Errors
No modeled service errors for this operation.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.