Class PresignedGetRequest
- Namespace
- Cloudflare.NET.R2.Models
- Assembly
- Cloudflare.NET.R2.dll
Defines the parameters for creating a presigned GET URL, which allows for direct, time-limited downloads.
public record PresignedGetRequest : IEquatable<PresignedGetRequest>
- Inheritance
-
PresignedGetRequest
- Implements
- Inherited Members
Constructors
PresignedGetRequest(string, TimeSpan, string?, string?)
Defines the parameters for creating a presigned GET URL, which allows for direct, time-limited downloads.
public PresignedGetRequest(string Key, TimeSpan ExpiresAfter, string? ResponseContentType = null, string? ResponseContentDisposition = null)
Parameters
KeystringThe object key (path) of the file to be downloaded from the bucket.
ExpiresAfterTimeSpanThe duration for which the presigned URL will be valid.
ResponseContentTypestringAn optional
response-content-typeoverride. Because the override is part of the signed query string, R2 stamps it as theContent-Typeheader of its response, and the URL holder cannot alter it after signing.ResponseContentDispositionstringAn optional
response-content-dispositionoverride. Because the override is part of the signed query string, R2 stamps it as theContent-Dispositionheader of its response (e.g. anattachmentdirective carrying a save-as filename), and the URL holder cannot alter it after signing.
Properties
ExpiresAfter
The duration for which the presigned URL will be valid.
public TimeSpan ExpiresAfter { get; init; }
Property Value
Key
The object key (path) of the file to be downloaded from the bucket.
public string Key { get; init; }
Property Value
ResponseContentDisposition
An optional response-content-disposition override. Because the override is part of the signed query
string, R2 stamps it as the Content-Disposition header of its response (e.g. an attachment
directive carrying a save-as filename), and the URL holder cannot alter it after signing.
public string? ResponseContentDisposition { get; init; }
Property Value
ResponseContentType
An optional response-content-type override. Because the override is part of the signed query string, R2
stamps it as the Content-Type header of its response, and the URL holder cannot alter it after signing.
public string? ResponseContentType { get; init; }