当前位置: 代码迷 >> Web前端 >> 文件下传类型判断
  详细解决方案

文件下传类型判断

热度:245   发布时间:2012-10-31 14:37:31.0
文件上传类型判断
检查上传文件类型:
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  
这种方法没啥实际意义的...
  相关解决方案