sys_wel_deal.asp
上传用户:stone001
上传日期:2016-10-28
资源大小:685k
文件大小:4k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
ASP/ASPX
- <!--插入html头部分以及数据库接口-->
- <!--#include file="in_conn.asp"-->
- <!--#include file="UpLoadClass.asp"-->
- <body>
- <!--插入网站置顶-->
- <%
- Server.ScriptTimeOut=5000
- if u_name="" then
- Response.Redirect "log_err.asp"
- else
- %>
- <!--#include file="in_topmb.asp"-->
- <% end if %>
- <%
- if u_power<2 OR u_name<>DEF_sysadm then
- Response.Redirect "resp.asp?cmd=adm_bigpower"
- end if
- %>
- <%
- dim request2
- '建立上传对象
- set request2=New UpLoadClass
- '使用手动方式保存
- request2.AutoSave=2
- request2.SavePath="img/top/"
- request2.FileType="gif/jpg/swf"
- '打开对象
- request2.Open()
- '是否还原为系统默认的欢迎横图
- IF request2.FORM("hidre")="reset" THEN
- sqlstr="SELECT topfile FROM tblsys"
- rs.open sqlstr,conn,1,2
- '判断原文件是否存在,在就删除!!
- dim fpath222
- dim fso222
- if Left(rs("topfile"),8)="img/top/" then
- fpath222=server.MapPath(rs("topfile"))
- set fso222=Server.CreateObject("Scripting.FileSystemObject")
- if fso222.FileExists(fpath222) then
- fso222.DeleteFile fpath222,True
- end if
- set fso222=nothing
- end if
- rs("topfile")="img/welcome.gif"
- rs.update
- rs.close
- set request2=Nothing
- Response.Redirect "rego.asp?cmd=skin_ok"
- END IF
- %>
- <table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
- <td width="100%" height="100%">
- <a href="index.asp">[首页]</a>-<a href="sys.asp">后台维护</a>-<font class="ft1">上传欢迎横图</font>
- </td>
- </tr></table>
- <table align="center" width="700" height="101" border="0" cellspacing="0" cellpadding="6" class="rdd">
- <tr>
- <td width="150" valign="top" class="rdk2">
- <!--插入左部分-->
- <!--#include file="in_sys_left.asp"-->
- </td>
- <td valign="top"><br>
- <%
- '保存文件
- request2.MaxSize=204800
- viiii=request2.Save("strLogo",0)
- select case request2.Form("strLogo_Err")
- case -1:
- response.write "没有文件上传<br>"&"<a href='javascript:history.go(-1);'>[点击这里<Font color=red>返回修改</Font>]</a>"
- case 0:
- vtopfile=Request2.SavePath&Request2.Form("strLogo")
- sqlstr="SELECT topfile,topw,toph FROM tblsys"
- rs.open sqlstr,conn,1,2
- '判断原文件是否存在,在就删除!!
- if Left(rs("topfile"),8)="img/top/" then
- dim fpath
- dim fso1
- fpath=server.MapPath(rs("topfile"))
- set fso1=Server.CreateObject("Scripting.FileSystemObject")
- if fso1.FileExists(fpath) then
- fso1.DeleteFile fpath,True
- end if
- set fso1=nothing
- end if
- rs("topfile")=vtopfile
- '判断是否是flash文件
- if Right(vtopfile,3)="swf" then
- if isNumeric(Request2.FORM("txtw")) AND isNumeric(Request2.FORM("txth")) then
- vtopw=CInt(Request2.FORM("txtw"))
- vtoph=CInt(Request2.FORM("txth"))
- else
- vtopw=280
- vtoph=90
- end if
- if vtopw<=280 AND vtoph<=90 AND vtopw>0 AND vtoph>0 then
- rs("topw")=vtopw
- rs("toph")=vtoph
- else
- rs("topw")=280
- rs("toph")=90
- end if
- end if
- rs.update
- rs.close
- set request2=Nothing
- Response.Redirect "rego.asp?cmd=skin_ok"
- case 1:
- response.write "文件太大,拒绝上传<br>"&"<a href='javascript:history.go(-1);'>[点击这里<Font color=red>返回修改</Font>]</a>"
- case 2:
- response.write "文件格式不对,拒绝上传<br>"&"<a href='javascript:history.go(-1);'>[点击这里<Font color=red>返回修改</Font>]</a>"
- case 3:
- response.write "文件太大且格式不对,拒绝上传<br>"&"<a href='javascript:history.go(-1);'>[点击这里<Font color=red>返回修改</Font>]</a>"
- end select
- set request2=Nothing
- %>
- </td>
- </tr>
- </table>
- <!--插入在线统计-->
- <!--#include file="in_online.asp"-->
- <!--插入网站置底-->
- <!--#include file="in_bottom.asp"-->
- </body>
- </html>