fPutObject method
Implementation
Future<String> fPutObject(
String bucket,
String object,
String filePath, [
Map<String, String>? metadata,
]) async {
MinioInvalidBucketNameError.check(bucket);
MinioInvalidObjectNameError.check(object);
metadata ??= {};
metadata = insertContentType(metadata, filePath);
metadata = prependXAMZMeta(metadata);
final file = File(filePath);
final stat = await file.stat();
if (stat.size > maxObjectSize) {
throw MinioError(
'$filePath size : ${stat.size}, max allowed size : 5TB',
);
}
return putObject(
bucket,
object,
file.openRead().cast<Uint8List>(),
size: stat.size,
metadata: metadata,
);
}