MultipartFileRecreatable.fromFileSync constructor
MultipartFileRecreatable.fromFileSync(})
Creates a MultipartFileRecreatable object from a File in filePath
.
Implementation
factory MultipartFileRecreatable.fromFileSync(
String filePath, {
String? filename,
MediaType? contentType,
Map<String, List<String>>? headers,
}) {
filename ??= p.basename(filePath);
final file = File(filePath);
final length = file.lengthSync();
final stream = file.openRead();
return MultipartFileRecreatable(
stream,
length,
filename: filename,
contentType: contentType,
headers: headers,
);
}