putFileAs method
Stores file in directory as name, and returns the path.
Implementation
Future<String> putFileAs(String directory, Object file, String name) async {
final String fileName = normalizeDiskPath(name, disk: this.name);
if (fileName.isEmpty) {
throw ArgumentError.value(name, 'name', 'A file name is required');
}
final String path = joinDiskPath(
normalizeDiskPath(directory, disk: this.name),
fileName,
);
await put(path, _FileSource.of(file).open());
return path;
}