获取文件后缀名(zip,rar等)

var filename = file.name;
var index1 = filename.lastIndexOf(".");
var index2 = filename.length;
var ext = filename.substring(index1 + 1, index2);//后缀名

posted @ 2018-10-30 11:25  quitpoison  阅读(651)  评论(0编辑  收藏  举报