A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.

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.

Constructors

MultipartFile(String field, Stream<List<int>> stream, int length, { String filename, MediaType contentType })

Creates a new MultipartFile from a chunked Stream of bytes. The length of the file in bytes must be known in advance. If it's not, read the data from the stream and use MultipartFile.fromBytes instead.

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. Defaults to application/octet-stream.

read-only
field String

The name of the form field for the file.

read-only
filename String

The basename of the file. May be null.

read-only
isFinalized bool

Whether finalize has been called.

read-only
length int

The size of the file in bytes. This must be known in advance, even if this file is created from a ByteStream.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

finalize() ByteStream

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited