<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<!--#INCLUDE FILE="../HXINCLUDE/HX_photo.asp"-->
<%set upload=new upload_file:editname=upload.form("editname")
call WS_S.ChkIsOuter()
filepath="workannex/"
for each formName in upload.File
	set file=upload.File(formName)
    fileExt=lcase(file.FileExt)	'得到的文件扩展名不含有.
    if file.filesize<100 then
	 response.write "<script language=javascript>alert('请先选择你要上传的文件！');history.go(-1);</script>"
	 response.end
    end if  
	if fileext<>"doc" and fileext<>"txt" and fileext<>"rar" then
		fileExt="gif"
		response.write "<script language=javascript>alert('只能上传DOC、TXT、RAR格式的文件！');history.go(-1);</script>"
		response.end
    end if
	if file.filesize>(200000*1024) then
		response.write "<script language=javascript>alert('文件大小不能超过200M！');history.go(-1);</script>"
		response.end
	end if
 randomize
 ranNum=int(90000*rnd)+10000
 filename=filepath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt 
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
    WS_S.CheckDir filepath,True
    FileSeverPath=Server.mappath(FileName)
    file.SaveToFile FileSeverPath
	if WS_S.HX_ScanFile(FileSeverPath) then
    WS_S.CheckFile FileSeverPath,True 
    HX_GoBack "对不起,您上传的文件中含有木马程序,所以不能上传!",""
    end if
 end if
set file=nothing
next
set upload=nothing
response.write "<script>alert('上传成功');window.opener.document.form1."&editname&".value='"&FileName&"';window.close();</script>"
response.end
%>