javascript program to know extension of a file name code example
Example 1: javascript find file extension from string
var ext = fileName.split('.').pop();
Example 2: how to get the extension from filename using javascript
var ext = fileName.substr(fileName.lastIndexOf('.') + 1);