Table of Contents

Class GetPreSignedUrlRequest

Namespace
Amazon.S3.Model
Assembly
AWSSDK.S3.dll

The parameters to create a pre-signed URL to a bucket or object.

public class GetPreSignedUrlRequest : AmazonWebServiceRequest
Inheritance
GetPreSignedUrlRequest

Remarks

For more information, refer to: http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html.
Required Parameters: BucketName, Expires
Optional Parameters: Key, VersionId, Verb: default is GET

Constructors

GetPreSignedUrlRequest()

public GetPreSignedUrlRequest()

Properties

BucketName

The name of the bucket to create a pre-signed url to, or containing the object.

public string BucketName { get; set; }

Property Value

string

ContentType

A standard MIME type describing the format of the object data.

public string ContentType { get; set; }

Property Value

string

Remarks

The content type for the content being uploaded. This property defaults to "binary/octet-stream". For more information, refer to: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17.

Note that if content type is specified, it should also be included in the HttpRequest headers of the eventual upload request, otherwise a signature error may result.

Expires

The expiry date and time for the pre-signed url.

public DateTime Expires { get; set; }

Property Value

DateTime

Headers

The collection of headers for the request.

public HeadersCollection Headers { get; }

Property Value

HeadersCollection

Key

The key to the object for which a pre-signed url should be created.

public string Key { get; set; }

Property Value

string

Remarks

This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." is interpreted as use parent directory. For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri

Metadata

The collection of meta data for the request.

public MetadataCollection Metadata { get; }

Property Value

MetadataCollection

Parameters

Custom parameters to include in the signed request, so that they are tamper-proof.

public ParameterCollection Parameters { get; }

Property Value

ParameterCollection

PartNumber

The part number for the multipart upload for which a pre-signed url should be created.

public int PartNumber { get; set; }

Property Value

int

Protocol

The requested protocol (http/https) for the pre-signed url.

public Protocol Protocol { get; set; }

Property Value

Protocol

Remarks

Defaults to https.

RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests.

public RequestPayer RequestPayer { get; set; }

Property Value

RequestPayer

ResponseHeaderOverrides

A set of response headers that should be returned with the pre-signed url creation response.

public ResponseHeaderOverrides ResponseHeaderOverrides { get; set; }

Property Value

ResponseHeaderOverrides

ServerSideEncryptionCustomerMethod

The Server-side encryption algorithm to be used with the customer provided key.

public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod { get; set; }

Property Value

ServerSideEncryptionCustomerMethod

ServerSideEncryptionKeyManagementServiceKeyId

The id of the AWS Key Management Service key that Amazon S3 should use to encrypt and decrypt the object. If a key id is not specified, the default key will be used for encryption and decryption.

public string ServerSideEncryptionKeyManagementServiceKeyId { get; set; }

Property Value

string

ServerSideEncryptionMethod

Specifies the encryption used on the server to store the content.

public ServerSideEncryptionMethod ServerSideEncryptionMethod { get; set; }

Property Value

ServerSideEncryptionMethod

Remarks

Default is None.

If specifying encryption (not None), the corresponding request must include header "x-amz-server-side-encryption" with the value of the encryption.

UploadId

The upload id for the multipart upload for which a pre-signed url should be created.

public string UploadId { get; set; }

Property Value

string

Verb

The verb for the pre-signed url.

public HttpVerb Verb { get; set; }

Property Value

HttpVerb

Remarks

Accepted verbs are GET, PUT, DELETE and HEAD. Default is GET.

VersionId

Version id for the object that the pre-signed url will reference. If not set, the url will reference the latest version of the object.

public string VersionId { get; set; }

Property Value

string

Remarks

This is the VersionId for the S3 Object you want to get a PreSigned URL for. The VersionId property will be ignored for PreSigned "PUT" requests and for requests that don't specify the Key property.

Methods

IsSetExpires()

Checks if Expires property is set.

public bool IsSetExpires()

Returns

bool

true if Expires property is set.