Class PresignedUploadPartRequest
- Namespace
- Cloudflare.NET.R2.Models
- Assembly
- Cloudflare.NET.R2.dll
Defines the parameters for creating a presigned URL for a single part of a multipart upload.
public record PresignedUploadPartRequest : IEquatable<PresignedUploadPartRequest>
- Inheritance
-
PresignedUploadPartRequest
- Implements
- Inherited Members
Constructors
PresignedUploadPartRequest(string, string, int, TimeSpan, long, string, IEnumerable<S3PostCondition>?, IReadOnlyDictionary<string, string>?, UploadChecksum?)
Defines the parameters for creating a presigned URL for a single part of a multipart upload.
public PresignedUploadPartRequest(string Key, string UploadId, int PartNumber, TimeSpan ExpiresAfter, long ContentLength, string ContentType, IEnumerable<S3PostCondition>? Conditions = null, IReadOnlyDictionary<string, string>? HeadersToSign = null, UploadChecksum? Checksum = null)
Parameters
KeystringThe object key (path).
UploadIdstringThe ID of the multipart upload.
PartNumberintThe number of the part to be uploaded.
ExpiresAfterTimeSpanThe duration for which the URL is valid.
ContentLengthlongThe exact size of the part to be uploaded. This will be enforced by R2.
ContentTypestringThe MIME type of the file to be uploaded (e.g., "application/octet-stream"). This is enforced by R2.
ConditionsIEnumerable<S3PostCondition>Optional S3 POST policy conditions to enforce additional constraints on the upload.
HeadersToSignIReadOnlyDictionary<string, string>An optional dictionary of additional headers to include in the signature, enforcing them on the client-side upload.
ChecksumUploadChecksumAn optional digest to bind this part's bytes to. Its algorithm's header is signed into the URL, the client must send it, and R2 rejects the part with 400
BadDigest(recording nothing) when the arriving bytes do not hash to the stated digest. Only algorithms whose IsSupportedForPartUploads is true are accepted here (Crc32, Crc32C, Md5): R2 answers 501NotImplementedto a part upload carrying a SHA-1 or SHA-256 checksum header, so URL generation refuses those up front. When the same header also appears inHeadersToSign, this parameter wins.
Properties
Checksum
An optional digest to bind this part's bytes to. Its algorithm's header is signed into the URL, the client
must send it, and R2 rejects the part with 400 BadDigest (recording nothing) when the arriving bytes
do not hash to the stated digest. Only algorithms whose
IsSupportedForPartUploads is true are accepted here
(Crc32, Crc32C,
Md5): R2 answers 501 NotImplemented to a part upload carrying a
SHA-1 or SHA-256 checksum header, so URL generation refuses those up front. When the same header also
appears in HeadersToSign, this parameter wins.
public UploadChecksum? Checksum { get; init; }
Property Value
Conditions
Optional S3 POST policy conditions to enforce additional constraints on the upload.
public IEnumerable<S3PostCondition>? Conditions { get; init; }
Property Value
ContentLength
The exact size of the part to be uploaded. This will be enforced by R2.
public long ContentLength { get; init; }
Property Value
ContentType
The MIME type of the file to be uploaded (e.g., "application/octet-stream"). This is enforced by R2.
public string ContentType { get; init; }
Property Value
ExpiresAfter
The duration for which the URL is valid.
public TimeSpan ExpiresAfter { get; init; }
Property Value
HeadersToSign
An optional dictionary of additional headers to include in the signature, enforcing them on the client-side upload.
public IReadOnlyDictionary<string, string>? HeadersToSign { get; init; }
Property Value
Key
The object key (path).
public string Key { get; init; }
Property Value
PartNumber
The number of the part to be uploaded.
public int PartNumber { get; init; }
Property Value
UploadId
The ID of the multipart upload.
public string UploadId { get; init; }