I would like know how to get the name of file and type that I have uploaded in flutter-web project. So, for example.. I would like to get the name like hello.png
or task_result.pdf
So far, I have followed this Choose a File and send through POST with Flutter Web to upload the file like this
startWebFilePicker() async {
html.InputElement uploadInput = html.FileUploadInputElement();
uploadInput.multiple = true;
uploadInput.draggable = true;
uploadInput.click();
uploadInput.onChange.listen((e) {
final files = uploadInput.files;
final file = files[0];
final reader = new html.FileReader();
reader.onLoadEnd.listen((e) {
_handleResult(reader.result);
});
reader.readAsDataUrl(file);
});
}
but I stuck to get the name of the file.. is there a way to get the name of user's file that being uploaded to web?