var ext = file.slice(file.lastIndexOf(".")+1).toLowerCase(); if ("xls" != ext) { alert("只能上传Excle文件"); return false; }
上传格式判断方法
原文:https://www.cnblogs.com/luozhixiang/p/13367367.html