According to the specifications of HTML5, a file upload control should
not reveal the real local path to the file you have selected, if you
manipulate its value string with JavaScript. Instead, the string that
is returned by the script, which handles the file information is
C:\fakepath.
This requirement is already implemented in Internet Explorer 8 – the
real path to the file will be shown only if the page that contains the
control is added to the trusted sites collection of the browser. That
made sense; essentially the browser is feeding that lame C:\fakepath\
text in.
Reference
You can Just get the name of selected file using this:
var fileName = fileInput.value.replace("C:\\fakepath\\", "");