I need to return only the file name from an HTML input file.
The JavaScript code im using to get
I hope this works.
var fullFileName = document.getElementById("whatever").value; var fileName = fullFileName.substr(fullFileName.lastIndexOf("\\")+1, fullFileName.length);
Here is the fiddle for that Fiddle