AWSFile.fromPath constructor

AWSFile.fromPath(
  1. String path, {
  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

factory AWSFile.fromPath(
  String path, {
  String? name,
  String? contentType,
}) = AWSFilePlatform.fromPath;