readFileInputElementAsString function
Future<String?>
readFileInputElementAsString(
- FileUploadInputElement? input, [
- bool removeExifFromImage = false
Reads selected file of input
as String.
Implementation
Future<String?> readFileInputElementAsString(FileUploadInputElement? input,
[bool removeExifFromImage = false]) async {
if (input == null || input.files == null || input.files!.isEmpty) return null;
var file = input.files!.first;
String? data;
if (removeExifFromImage) {
var dataURL = await removeExifFromImageFile(file);
if (dataURL != null) {
data = DataURLBase64.parseMimeTypeAsString(dataURL);
}
}
data ??= await readFileDataAsText(file);
return data;
}