UploadFile class
A single file entry for multipart upload.
Constructors
- UploadFile.fromBytes({required String fieldName, required Uint8List bytes, required String filename, String contentType = 'application/octet-stream'})
-
const
- UploadFile.fromFile({required String fieldName, required File file, String? filename, String contentType = 'application/octet-stream'})
-
const
Properties
- bytes → Uint8List?
-
Source bytes. Exactly one of bytes or file must be provided.
final
- contentType → String
-
MIME type (e.g.
image/jpeg). Defaults toapplication/octet-stream.final - fieldName → String
-
The field name used in the multipart form.
final
- file → File?
-
final
- filename → String
-
The filename sent in the
Content-Dispositionheader.final - hashCode → int
-
The hash code for this object.
no setterinherited
- resolvedFilename → String
-
Resolved filename for the
Content-Dispositionheader.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBytes(
) → Future< Uint8List> - Returns raw bytes, reading from file when necessary.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited