MultipartFile.fromBytes constructor

MultipartFile.fromBytes(
  1. String field,
  2. List<int> value,
  3. {String filename,
  4. MediaType contentType}
)

Creates a new MultipartFile from a byte array.

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

Implementation

factory MultipartFile.fromBytes(String field, List<int> value,
    {String filename, MediaType contentType}) {
  var stream = ByteStream.fromBytes(value);
  return MultipartFile(field, stream, value.length,
      filename: filename, contentType: contentType);
}