<!--#include file="UPLOAD.INC"-->
<link href="images/index.css" rel="stylesheet">
<%
if session("m_id")="" or session("m_user")="" then
	Response.Write "<script>parent.location.href='admin_login.asp';</script>"
	Response.End
end if

action=request("action")
dim arr(3)
dim upload,file,formName,formPath,iCount,filename,fileExt,i
set upload=new upload_5xSoft ''建立上传对象
						
formPath="../UpFile/" 

	''列出所有上传了的文件
    for each formName in upload.file
      set file=upload.file(formName)
	  if file.filesize>0 then
      if file.filesize>200*1024 then
		response.write "<font size=2>图片大小超过200K限制[<a href=# onclick=history.go(-1)>重新上传</a>]</font>"
		response.end
      end if



fileExt=lcase(right(file.filename,4))
 uploadsuc=false
Forum_upload="gif,jpg,jpeg,bmp,png,rar,zip,doc,rm,mp3,wav,mid,midi,ra,avi,mpg,mpeg,asf,asx,wma,mov,pdf"
 Forumupload=split(Forum_upload,",")
 for i=0 to ubound(Forumupload)
    if fileEXT="."&trim(Forumupload(i)) then
    uploadsuc=true
    exit for
    else
    uploadsuc=false
    end if
 next


if uploadsuc=false then
         response.write "<p style='margin-top:5px'>文件格式限制[<a href=# onclick=history.go(-1)>请重新上传</a>]</p>"
         response.end
      end if
	end if
						
	filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&file.FileName
	filename=replace(filename,";","")
	
    if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
       file.SaveAs Server.mappath(formpath&filename)   ''保存文件
       response.write "<p style='margin-top:5px'>上传成功 <a href=# onclick=history.go(-1)>重新上传</a></p>" 

	   end if
set file=nothing
next
set upload=nothing
Response.Write "<script>parent.form1."&action&".value='UpFile/"&FileName&"'</script>"
%>
