`

文件上传类型判断

    博客分类:
  • Js
阅读更多
检查上传文件类型:
function checkFile(obj){    
		var extend = obj.value.substring(obj.value.lastIndexOf(".")+1);    
		 if(extend==""){    
		   }else{    
			if(!(extend=="doc")){ 
		   alert("your file is not word file,please upload the correct file!");    
		   var nf = obj.cloneNode(true);    
		     nf.value='';    
		     obj.parentNode.replaceChild(nf, obj);    
		   return false;    
		}    
		   }    
		    return true;    
		}  
分享到:
评论
1 楼 pkfajax 2011-08-18  
这种方法没啥实际意义的...

相关推荐

Global site tag (gtag.js) - Google Analytics