<!--#include FILE="upload.inc"-->
<html>
<head><title></title>
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="Images/Admin_style.css">
</head>
<body bgcolor="#CEDBFF">
<%
nowtime=now()
sj=cstr(year(nowtime))+"-"+right("0"+cstr(month(nowtime)),2)+"-"+right("0"+cstr(day(nowtime)),2)
dim upload,file,formName,formPath,iCount,pic
set upload=new upload_f '建立上传对象
 	'--------将日期转化成文件名--------
	function MakedownName()
		dim fname
	  	fname = now()
		fname = replace(fname,"-","")
	 	fname = replace(fname," ","") 
		fname = replace(fname,":","")
	  	fname = replace(fname,"PM","")
	  	fname = replace(fname,"AM","")
		fname = replace(fname,"上午","")
	  	fname = replace(fname,"下午","")
	  	fname = int(fname) + int((10-1+1)*Rnd + 1)
		MakedownName=fname
	end function 
formPath="../pic/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)

  file.SaveAs Server.mappath(formPath&newname)   ''保存文件
  iCount=iCount+1
 end if
next
response.write newname
%>
<script language="JavaScript">
parent.myform.pic2.value+='<%=newname%>';
</script>
<%
set file=nothing
set upload=nothing  ''删除此对象
%>
</body>
</html>
