Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

RequestFormLimitsAttribute Class

Definition

Namespace:
Microsoft.AspNetCore.Mvc
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
RequestFormLimitsAttribute.cs
Source:
RequestFormLimitsAttribute.cs
Source:
RequestFormLimitsAttribute.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Sets the specified limits to the Form.

public ref class RequestFormLimitsAttribute : Attribute, Microsoft::AspNetCore::Mvc::Filters::IFilterFactory, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class RequestFormLimitsAttribute : Attribute, Microsoft.AspNetCore.Http.Metadata.IFormOptionsMetadata, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class RequestFormLimitsAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type RequestFormLimitsAttribute = class
 inherit Attribute
 interface IFilterFactory
 interface IFilterMetadata
 interface IOrderedFilter
 interface IFormOptionsMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type RequestFormLimitsAttribute = class
 inherit Attribute
 interface IFilterFactory
 interface IFilterMetadata
 interface IOrderedFilter
Public Class RequestFormLimitsAttribute
Inherits Attribute
Implements IFilterFactory, IFormOptionsMetadata, IOrderedFilter
Public Class RequestFormLimitsAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Inheritance
RequestFormLimitsAttribute
Attributes
Implements

Constructors

Name Description
RequestFormLimitsAttribute()

Properties

Name Description
BufferBody

Enables full request body buffering. Use this if multiple components need to read the raw stream. The default value is false.

BufferBodyLengthLimit

If BufferBody is enabled, this is the limit for the total number of bytes that will be buffered. Forms that exceed this limit will throw an InvalidDataException when parsed.

IsReusable

Gets a value that indicates if the result of CreateInstance(IServiceProvider) can be reused across requests.

KeyLengthLimit

A limit on the length of individual keys. Forms containing keys that exceed this limit will throw an InvalidDataException when parsed.

MemoryBufferThreshold

If BufferBody is enabled, this many bytes of the body will be buffered in memory. If this threshold is exceeded then the buffer will be moved to a temp file on disk instead. This also applies when buffering individual multipart section bodies.

MultipartBodyLengthLimit

A limit for the length of each multipart body. Forms sections that exceed this limit will throw an InvalidDataException when parsed.

MultipartBoundaryLengthLimit

A limit for the length of the boundary identifier. Forms with boundaries that exceed this limit will throw an InvalidDataException when parsed.

MultipartHeadersCountLimit

A limit for the number of headers to allow in each multipart section. Headers with the same name will be combined. Form sections that exceed this limit will throw an InvalidDataException when parsed.

MultipartHeadersLengthLimit

A limit for the total length of the header keys and values in each multipart section. Form sections that exceed this limit will throw an InvalidDataException when parsed.

Order

Gets the order value for determining the order of execution of filters. Filters execute in ascending numeric value of the Order property.

ValueCountLimit

A limit for the number of form entries to allow. Forms that exceed this limit will throw an InvalidDataException when parsed.

ValueLengthLimit

A limit on the length of individual form values. Forms containing values that exceed this limit will throw an InvalidDataException when parsed.

Methods

Name Description
CreateInstance(IServiceProvider)

Creates an instance of the executable filter.

Explicit Interface Implementations

Name Description
IFormOptionsMetadata.BufferBody
IFormOptionsMetadata.BufferBodyLengthLimit
IFormOptionsMetadata.KeyLengthLimit
IFormOptionsMetadata.MemoryBufferThreshold
IFormOptionsMetadata.MultipartBodyLengthLimit
IFormOptionsMetadata.MultipartBoundaryLengthLimit
IFormOptionsMetadata.MultipartHeadersCountLimit
IFormOptionsMetadata.MultipartHeadersLengthLimit
IFormOptionsMetadata.ValueCountLimit
IFormOptionsMetadata.ValueLengthLimit

Applies to


Feedback

Was this page helpful?