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.
Creates a content length range condition that restricts file size to the specified byte range.
Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z
public ContentLengthRangeCondition ContentLengthRange(
Int64 minimumLength,
Int64 maximumLength
)
The minimum allowed file size in bytes. Must be non-negative. Use 0 to allow empty files, or 1 to require non-empty files.
The maximum allowed file size in bytes. Must be greater than or equal to the minimum length.
Exception | Condition |
---|---|
System.ArgumentException | Thrown when is negative, or when is less than . |
// Allow files between 1KB and 5MB var sizeCondition = S3PostCondition.ContentLengthRange(1024, 5 * 1024 * 1024); // Allow documents up to 10MB var docSizeCondition = S3PostCondition.ContentLengthRange(0, 10 * 1024 * 1024);
.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