MultipartFile class

A file to be uploaded as part of a MultipartRequest.

This doesn't need to correspond to a physical file.

Constructors

MultipartFile(String field, Stream<List<int>> stream, int length, {String? filename, MediaType? contentType})
Creates a new MultipartFile from a chunked Stream of bytes.
MultipartFile.fromBytes(String field, List<int> value, {String? filename, MediaType? contentType})
Creates a new MultipartFile from a byte array.
factory
MultipartFile.fromString(String field, String value, {String? filename, MediaType? contentType})
Creates a new MultipartFile from a string.
factory

Properties

contentType → MediaType
The content-type of the file.
final
field String
The name of the form field for the file.
final
filename String?
The basename of the file.
final
hashCode int
The hash code for this object.
no setterinherited
isFinalized bool
Whether finalize has been called.
no setter
length int
The size of the file in bytes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

finalize() → ByteStream
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromPath(String field, String filePath, {String? filename, MediaType? contentType}) Future<MultipartFile>
Creates a new MultipartFile from a path to a file on disk.