Table of Contents

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

Key string

The object key (path).

UploadId string

The ID of the multipart upload.

PartNumber int

The number of the part to be uploaded.

ExpiresAfter TimeSpan

The duration for which the URL is valid.

ContentLength long

The exact size of the part to be uploaded. This will be enforced by R2.

ContentType string

The MIME type of the file to be uploaded (e.g., "application/octet-stream"). This is enforced by R2.

Conditions IEnumerable<S3PostCondition>

Optional S3 POST policy conditions to enforce additional constraints on the upload.

HeadersToSign IReadOnlyDictionary<string, string>

An optional dictionary of additional headers to include in the signature, enforcing them on the client-side upload.

Checksum UploadChecksum

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.

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

UploadChecksum

Conditions

Optional S3 POST policy conditions to enforce additional constraints on the upload.

public IEnumerable<S3PostCondition>? Conditions { get; init; }

Property Value

IEnumerable<S3PostCondition>

ContentLength

The exact size of the part to be uploaded. This will be enforced by R2.

public long ContentLength { get; init; }

Property Value

long

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

string

ExpiresAfter

The duration for which the URL is valid.

public TimeSpan ExpiresAfter { get; init; }

Property Value

TimeSpan

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

IReadOnlyDictionary<string, string>

Key

The object key (path).

public string Key { get; init; }

Property Value

string

PartNumber

The number of the part to be uploaded.

public int PartNumber { get; init; }

Property Value

int

UploadId

The ID of the multipart upload.

public string UploadId { get; init; }

Property Value

string