AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Represents an exact match condition in an S3 POST policy.

Inheritance Hierarchy

System.Object
  Amazon.S3.Model.S3PostCondition
    Amazon.S3.Model.ExactMatchCondition

Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z

Syntax

C#
public class ExactMatchCondition : S3PostCondition

The ExactMatchCondition type exposes the following members

Constructors

NameDescription
Public Method ExactMatchCondition(string, string)

Initializes a new instance of the Amazon.S3.Model.ExactMatchCondition class.

Properties

NameTypeDescription
Public Property ExpectedValue System.String

Gets the exact value that the form field must have.

Public Property FieldName System.String

Gets the name of the form field that must match the expected value.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.7.2 or higher.

NameDescription
Public Method WriteToJsonWriter(Utf8JsonWriter)

Writes this condition to the specified JSON writer as an object with the field name and expected value.

Examples

// Require uploads to have public-read ACL
var condition = new ExactMatchCondition("acl", "public-read");
            
// Require specific content type
var contentTypeCondition = new ExactMatchCondition("Content-Type", "image/jpeg");
            

Remarks

An exact match condition requires that a form field in the POST request has exactly the specified value. This is useful for enforcing specific values for metadata, ACL settings, storage class, etc.

Common use cases include:

Enforcing a specific bucket: new ExactMatchCondition("bucket", "my-uploads")Requiring a specific ACL: new ExactMatchCondition("acl", "public-read")Setting required metadata: new ExactMatchCondition("x-amz-meta-category", "photos")

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer