var FileName = $("#file").val();
var index1=FileName.lastIndexOf(".");
var index2=FileName.length;
var suffix=FileName.substring(index1, index2);//后缀名
var FileName = $("#file").val();
var index1=FileName.lastIndexOf(".");
var index2=FileName.length;
var suffix=FileName.substring(index1, index2);//后缀名
转载于:https://www.cnblogs.com/webSciprt/p/8796950.html