MultipartConfig class
Configuration for handling multipart file uploads.
This class controls limits and behavior for file uploads through multipart form data. It helps protect against denial-of-service attacks and ensures uploaded files meet security requirements.
Example:
final config = MultipartConfig(
maxMemory: 64 * 1024 * 1024,
maxFileSize: 20 * 1024 * 1024,
allowedExtensions: {'jpg', 'png', 'pdf', 'docx'},
uploadDirectory: 'storage/uploads',
);
- Implemented types
Constructors
Properties
-
allowedExtensions
→ Set<
String> -
Set of allowed file extensions for uploads.
final
- filePermissions → int
-
File permissions for uploaded files in octal notation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxDiskUsage → int
-
Maximum total disk usage per request in bytes.
final
- maxFileSize → int
-
Maximum file size allowed for individual uploads in bytes.
final
- maxMemory → int
-
Maximum memory size allowed for file uploads in bytes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uploadDirectory → String
-
Directory where uploaded files will be stored.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
ConfigValidationContext context) → void -
Creates a ValidatableConfiguration.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited