AWSFilePlatform.fromData constructor

AWSFilePlatform.fromData(
  1. List<int> data, {
  2. String? name,
  3. String? contentType,
})

Creates an AWSFile from a path, optionally specifying a file name.

On VM platforms, the path is the absolute path to a file in the file system.

On Web, the path can be an object url created by URL.createObjectURL() . When passing an object url, it's recommended to set a value for name.

Throws InvalidFileException if cannot get a file content stream from the path.

Implementation

AWSFilePlatform.fromData(
  List<int> data, {
  super.name,
  super.contentType,
})  : _stream = null,
      _inputFile = null,
      _size = data.length,
      super.protected(
        bytes: data,
      );