<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
BODY{
font-size:9pt
}
.tx1 { height: 20px;font-size: 9pt; border: 1px solid; border-color: #000000; color: #0000FF}
-->
</style>
<SCRIPT>
var s_type="<%=UpFileType%>";
var MaxFileSize=<%=MaxFileSize%>;
function ch(o){
	var path=o.value;
	var ext = path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase();
	var re = new RegExp("(^|\\s|,)" + ext + "($|\\s|,)", "ig");
	var localfile = path.substr(path.replace(/\\/g, '/').lastIndexOf('/') + 1);
	if(s_type != '' && (re.exec(s_type) == null || ext == '')) {
		alert('对不起，不支持上传此类扩展名的附件。');
		 oo=eval("document.form."+o.name);
		oo.outerHTML=oo.outerHTML
	}	
	//else{
		
	//	if(document.getElementById&&document.all)
	//		s_big(o,o)
	//}
}
var img=null; 
function s_big(o,oo) 
{ 
if(img)img.removeNode(true); 
img=document.createElement("img"); 
img.style.position="absolute"; 
img.style.visibility="hidden"; 
img.width = 0; 
img.height = 0; 
img.attachEvent("onreadystatechange",orsc_big); 
img.attachEvent("onerror",oe_big); 
document.body.insertAdjacentElement("beforeend",img); 
img.src=o.value; 
img.oo=oo;
} 
function oe_big() 
{ 
//alert("cant load img"); 
} 
function orsc_big() 
{ 
	if(img.readyState!="complete")return false; 
	//alert("图片大小："+img.offsetWidth+"X"+img.offsetHeight); 
	if(img.fileSize>MaxFileSize){
		alert("对不起，图片("+Math.round(img.fileSize/1024)+"KB)"+"超过最大("+MaxFileSize+")KB尺寸") ;	
		img.oo.outerHTML=img.oo.outerHTML;
		//$_("bt").disabled=true;
	}
	else{
		//$_("bt").disabled=false
		
	}
} 
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<% 
on error resume next
url=request("acd")
if url<>"" then
	url=Add_Root_Dir(url)
	Set fso = CreateObject("Scripting.FileSystemObject") 
	IF fso.FileExists(server.MapPath(url)) Then
		fso.DeleteFile(server.MapPath(url))
		response.Write"<script>parent.document.myform.m_pic.value='';</script>"
	End IF
end if
%>
<form action="upfilepicture.asp" method="post" name="form"  enctype="multipart/form-data">
  <input name="FileName" type="FILE" class="tx1" size="25" onChange="ch(this)">
  <input type="submit" name="Submit" value="上传" style="border:1px double rgb(88,88,88);font:9pt">
</form>
</body>
</html>