1function getFileNameWithExt(event) {
2
3 if (!event || !event.target || !event.target.files || event.target.files.length === 0) {
4 return;
5 }
6
7 const name = event.target.files[0].name;
8 const lastDot = name.lastIndexOf('.');
9
10 const fileName = name.substring(0, lastDot);
11 const ext = name.substring(lastDot + 1);
12
13 outputfile.value = fileName;
14 extension.value = ext;
15
16}