<%
if session("admin")="" then
	response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='index.asp';</script>"
	response.End
else
	if session("flag")>1 then
	response.Write "<script LANGUAGE='javascript'>alert('您没有此项目管理权限！请于管理员联系!!!');window.location.href='admin.asp';</script>"
	response.End
	end if
end if
%>
<!--#include file="upload_wj.inc"-->
<%Server.ScriptTimeOut=24*60*60*60%>
<link href="images/css.css" rel="stylesheet" type="text/css">

<%
'dim filelx filename filename1
'filelx=request("filelx")

set upload=new upload_file
if upload.form("act")="uploadfile" then
	filepath=trim(upload.form("filepath"))
	
	
	i=0
	for each formName in upload.File
		set file=upload.File(formName)
 
'得到的文件扩展名不含有.
  filelxx=split(File.FileName, ".")
randomize
 ranNum=int(90000*rnd)+10000
 filename=filepath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&filelxx(1)
%>
<%
 if file.FileSize=0 then         
  response.Write "请选择您要上传的文件,重新上传!!! <br>"
response.End
  elseif file.FileSize>4000000 then 
  response.Write "文件过大~~你上传的文件不得大于 4M !!! <br>"
response.End
else
  file.SaveAs Server.mappath(filename)  ''保存文件
  response.write "文件上传成功!!!　新文件名已复制到所需的位置，可关闭窗口！<br>"
  response.write "新文件名："&FileName&"<br>"
 
  if Ubound (filelxx)>=1 then
     if filelxx(1)="asp" or filelxx(1)="jsp" or filelxx(1)="php" or filelxx(1)="exe" or filelxx(1)="inc" or filelxx(1)="aspx" then
	 response.Write "可疑文件！！ 如果您要上传此文件，请先将其压缩为.zip文件重新上传。 <br>"
	 response.End
	 end if
	 session("filelx")=filelxx(1)
	 elseif Ubound (filelxx)<0 then
	 response.Write "您选择要上传的文件不存在,请选择文件重新上传!!! <br>"
	 response.End
else
	 session("filelx")=filelxx(0)
end if
  if filelx="swf" then
  response.write "<script>window.opener.document."&upload.form("FormName")&".size.value='"&int(file.FileSize/1024)&" K'</script>"
  end if
  response.write "<script>window.opener.document."&upload.form("FormName")&"."&upload.form("EditName")&".value='"&FileName&"'</script>"
%>
<%
end if
set file=nothing
next
set upload=nothing
end if
%>

<style type="text/css">
<!--
.ll {
	font-family: "新宋体";
	font-size: 24px;
	font-style: normal;
	color: #0066CC;
	background-color: #FFFFCC;
	text-align: center;
	vertical-align: middle;
}
-->
</style>
<script language="javascript">
window.close();
</script>