Table of Contents

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

Key string

The object key (path) of the file to be downloaded from the bucket.

ExpiresAfter TimeSpan

The duration for which the presigned URL will be valid.

ResponseContentType string

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.

ResponseContentDisposition string

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.

Properties

ExpiresAfter

The duration for which the presigned URL will be valid.

public TimeSpan ExpiresAfter { get; init; }

Property Value

TimeSpan

Key

The object key (path) of the file to be downloaded from the bucket.

public string Key { get; init; }

Property Value

string

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

string

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; }

Property Value

string