Class PresignedPostRequest
- Namespace
- Cloudflare.NET.R2.Models
- Assembly
- Cloudflare.NET.R2.dll
Defines the parameters for creating a presigned POST URL for browser-based uploads.
public record PresignedPostRequest : IEquatable<PresignedPostRequest>
- Inheritance
-
PresignedPostRequest
- Implements
- Inherited Members
Constructors
PresignedPostRequest(string, TimeSpan, string?, (long Min, long Max)?, IEnumerable<S3PostCondition>?, IReadOnlyDictionary<string, string>?)
Defines the parameters for creating a presigned POST URL for browser-based uploads.
public PresignedPostRequest(string Key, TimeSpan ExpiresAfter, string? ContentType = null, (long Min, long Max)? ContentLengthRange = null, IEnumerable<S3PostCondition>? Conditions = null, IReadOnlyDictionary<string, string>? HeadersToSign = null)
Parameters
KeystringThe object key (path) where the file will be stored in the bucket.
ExpiresAfterTimeSpanThe duration for which the presigned URL will be valid.
ContentTypestringAn optional but recommended condition to enforce the MIME type of the uploaded file (e.g., "image/jpeg").
ContentLengthRange(long Min, long Max)?An optional but recommended condition to enforce the minimum and maximum size of the uploaded file in bytes.
ConditionsIEnumerable<S3PostCondition>An optional collection of custom S3 Post conditions to include in the policy, allowing for advanced validation scenarios.
HeadersToSignIReadOnlyDictionary<string, string>An optional dictionary of headers to include in the policy, enforcing them on the client-side upload. For POST, these are added as fields in the policy document.
Properties
Conditions
An optional collection of custom S3 Post conditions to include in the policy, allowing for advanced validation scenarios.
public IEnumerable<S3PostCondition>? Conditions { get; init; }
Property Value
ContentLengthRange
An optional but recommended condition to enforce the minimum and maximum size of the uploaded file in bytes.
public (long Min, long Max)? ContentLengthRange { get; init; }
Property Value
ContentType
An optional but recommended condition to enforce the MIME type of the uploaded file (e.g., "image/jpeg").
public string? ContentType { get; init; }
Property Value
ExpiresAfter
The duration for which the presigned URL will be valid.
public TimeSpan ExpiresAfter { get; init; }
Property Value
HeadersToSign
An optional dictionary of headers to include in the policy, enforcing them on the client-side upload. For POST, these are added as fields in the policy document.
public IReadOnlyDictionary<string, string>? HeadersToSign { get; init; }
Property Value
Key
The object key (path) where the file will be stored in the bucket.
public string Key { get; init; }