JS 判断上传文件类型
var video_src_file = $("#video_src_file").val();
var fileTypes = new Array("flv","3gp","mpeg","avi","mp4"); //定义可支持的文件类型数组
var fileTypeFlag = "0";
var newFileName = video_src_file.split('.');
newFileName = newFileName[newFileName.length-1];
for(var i=0;i<fileTypes.length;i++){
if(fileTypes[i] == newFileName){
fileTypeFlag = "1";
}
}
if(fileTypeFlag == "0"){
alert("视频文件必须是flv、mpeg、avi或3gp格式!");
return false;
}