<!--#Include File="Connection.Asp"-->
<!--#Include File="JaClog.Asp"-->
<!--#Include File="../JaInc/Upload_Inc.asp"-->
<%
Dim t,TT,newname
t = cint(Trim(Request.QueryString("t")))
if t=1 Then
 TT="BgSel"
else
if t=2 Then
 TT="cursel"
 
 else
if t=3 Then
 TT="bannersel"
 
  else
if t=4 Then
 TT="flytopsel"
 
else
if t=5 Then
 TT="Flysel"
else
if t=6 Then
 TT="classsel"
 
else
if t=7 Then
 TT="Saysel"
else
if t=8 Then
 TT="Musicsel"
else
if t=9 then
 TT="Upload"
else
 if t=10 then
 	tt="Images/img_home/Home/0" 
 else
   if t=11 then
 	tt="Images/img_Visual/show/0" 
end if 
end if  
end if
end if 
end if
end if
end if
end if
end if
end if
end if

Dim upload,file,upfilename,upfileext,ufp,FormName,UpLoadSize,tmpname
UpLoadSize = 1000
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize<10 or file.fileSize>UpLoadSize*1024 then
  Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('上传文件超过了"&UpLoadSize&"K的大小,请返回!');" & Chr(13)
		Response.write "javascript:history.go(-1);"&Chr(13)
		Response.write "</script>" & Chr(13)
    Response.End
end if
upfilename = split(file.FileName,".")

upfileext = upfilename(ubound(upfilename))
if lcase(upfileext)<>"jpg" and lcase(upfileext)<>"gif" and lcase(upfileext)<>"swf" and lcase(upfileext)<>"ani" then
  Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('上传格式不正确!');" & Chr(13)
		Response.write "javascript:history.go(-1);"&Chr(13)
		Response.write "</script>" & Chr(13)
    Response.End
end if
if t=10 or t=11 then
newname=session("newname")
'format(newname,"0000")
newname=right("0000"&newname,4)
file.saveas Server.mappath("../" & TT & "/" &newname&"."&upfileext)
else
file.saveas Server.mappath("../" & TT & "/" & file.FileName)
end if
'if tt=9 then
	'tmpname=upfilename(0)&upfileext
'else
	'tmpname=upfilename(0)
'end if	
 Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('上传图片成功!');" & Chr(13)
		if t<>10 and t<>11 then
        	Response.write "parent.form.sr.value='"&upfilename(0)&"';" & Chr(13)
		end if
		Response.Write "window.document.location.href='PhotoUpload.Asp';</script>"
		Response.write "</script>" & Chr(13)
    Response.End
%>