<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><!--#include file="../HXINCLUDE/HX_UPANNEX.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet type=text/css href="../HXinclude/HX_Style.css">
<body topmargin="8" leftmargin="0" bottommargin="0">
<%WS_S.ChkIsOuter
dim uploadsuc,Forumupload,uploadfiletype,pos,file_name,file_ext,file_size
set upload=new upload_5xSoft ''建立上传对象
filepath=upload.form("filepath")	'上传文件目录
FolderId=upload.form("FolderId")
set file=upload.file("doc")
 fileExt=lcase(right(file.filename,4))
 uploadsuc=false
 Forumupload=split("html,htm,asp,aspx,asa,asax,ascx,ashx,asmx,axd,cdx,cer,config,cs,csproj,licx,rem,resx,shtml,shtm,soap,stm,vb,vbproj,webinfo,cgi,pl,php,phtml,php3",",")
 for i=0 to ubound(Forumupload)
	if fileEXT="."&trim(Forumupload(i)) then
	uploadsuc=false
	exit for
	else
	uploadsuc=true
	end if
 next

if uploadsuc=false then HX_GoBack "文件格式不正确,重新上传",""
if file.filesize>0 then
	pos=instrRev(file.FileName,".")
	if pos=0 then
		file_name=file.FileName
		file_ext=""
	else
		file_name=mid(file.FileName,1,pos-1)
		file_ext =mid(file.FileName,pos+1,len(file.FileName)-1)
	end if
	file_size=file.filesize	
	if file_ext="asp" then file_ext="gif"
	 ColumnName="":Tablename="HX_NetDiskFolderOrFile":Orderby=""	 
     set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
	 rs.addnew:rs("WS_NetDiskFolderName")=file_name:rs("WS_NetDiskFolderDate")=now:rs("WS_NetDiskFolderEXT")=file_ext:rs("WS_FileID")=FolderId:rs("WS_NetDiskEmpId")=loginuid:rs.update
	 FileId=rs("WS_FDID"):WS_S.HX_RSClose rs	
	FileSeverPath=Server.mappath(filepath&FileId&"."&file_ext)
	if FileId<>"" then file.SaveAs FileSeverPath
	if WS_S.HX_ScanFile(FileSeverPath) then
	  WS_S.CheckFile FileSeverPath,True 
	  conn.execute("delete * from HX_NetDiskFolderOrFile where WS_FDID="&FileId)
	  HX_GoBack "对不起,您上传的文件中含有木马程序,所以不能上传!",""
	end if
	conn.execute("update HX_NetDiskFolderOrFile set WS_NetDiskFileNum=WS_NetDiskFileNum+1 where WS_FDID="&FolderId)
	response.write("<script>alert('文件上传成功！');window.parent.location='netdisk.asp?action=ViewFolder&FolderId="&FolderId&"';</script>")
end if
set file=nothing%>