fromPath static method

Future<MultipartFile> fromPath(
  1. String field,
  2. String filePath, {
  3. String? filename,
  4. MediaType? contentType,
})

Creates a new MultipartFile from a path to a file on disk.

filename defaults to the basename of filePath. contentType currently defaults to application/octet-stream, but in the future may be inferred from filename.

Throws an UnsupportedError if dart:io isn't supported in this environment.

Implementation

static Future<MultipartFile> fromPath(String field, String filePath,
        {String? filename, MediaType? contentType}) =>
    multipartFileFromPath(field, filePath,
        filename: filename, contentType: contentType);