上传格式判断方法

    var ext = file.slice(file.lastIndexOf(".")+1).toLowerCase();  
    if ("xls" != ext) {  
        alert("只能上传Excle文件");  
        return false;  
    } 

  

原文地址:https://www.cnblogs.com/luozhixiang/p/13367367.html