2200cl.asp
资源名称:wap.rar [点击查看]
上传用户:sking1122
上传日期:2020-09-24
资源大小:1005k
文件大小:6k
源码类别:
手机WAP编程
开发平台:
ASP/ASPX
- <% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
- <% Response.ContentType="text/vnd.wap.wml;charset=UTF-8" %>
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
- <!--#include file="cnscu/upload.inc"-->
- <!--#include file="conn.inc"-->
- <!--#include file="cnscucsb.asp"-->
- <!--#include file="cnscu/char.asp"-->
- <wml><%
- '====================================================================
- ' 请你保留这段说明,这并不会影响你的速度. 电脑交流:http://www.cnscu.cn
- ' 程序制作:横云 掌上校园收倾心整理收集于互联网,感谢你的支持!
- ' 升级时间: 2008-2-5 主页地址:HTTP://wap.cnscu.cn
- ' E-Mail: cnscu@126.com 客服QQ:554904632 QQ群:30493504 QQ群2:46659883
- '====================================================================
- %> <head>
- <meta http-equiv="Cache-Control" content="max-age=0"/>
- <meta http-equiv="Cache-Control" content="no-cache"/>
- </head>
- <%
- cnscu=request.querystring("cnscu")
- iduse=Session("useid")
- ltid=request("ltid")
- itid=request("itid")
- nais=request("nais")
- sq1="select * from upset where id=1"
- Set Rs1 = Server.CreateObject("Adodb.Recordset")
- rs1.open sq1,conn,1,2
- rstitle=c2u(rs1("title"))
- rsformPath=rs1("formPath")
- rsnamekind=rs1("namekind")
- rsfilesize=rs1("filesize")
- rsallowedfile=rs1("allowedfile")
- rsforceup=rs1("forceup")
- rs1.close
- Set rs1=Nothing
- If Right(rsformPath,1)<>"" Then rsformPath=rsformPath&""
- %>
- <%
- dim upload,file,formName,formPath,iCount
- Dim sjs,fname,i,l,newfilelist,uploaddir,filename,ii
- ''--------------------------
- Server.ScriptTimeOut=999999
- set upload=new upload_5xsoft
- ''---------------------------获得变量值
- fullpath=Server.Mappath("")&""
- addip=request.serverVariables("remote_host")
- title=upload.form("title")
- nais=upload.form("nais")
- explain=upload.form("explain")
- addid=session("id")
- ''--------------------------保存路径
- formPath=rsformPath
- fullpath=fullpath&rsformPath
- On Error Resume Next
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set fldr = fso.GetFolder(fullpath)
- If err<>0 Then response.Redirect"err.asp?id=6&nais="&nais&"&cnscu="&cnscu&""
- ''--------------------------
- iCount=0
- for each formName in upload.objFile ''列出所有上传了的文件
- set file=upload.file(formName) ''生成一个文件对象
- size=file.filesize
- ''-------------------------限制文件大小
- If size>rsfilesize*1024 Then response.Redirect"err.asp?id=3&nais="&nais&"&cnscu="&cnscu&""
- If size=0 Then response.Redirect"err.asp?id=5&nais="&nais&"&cnscu="&cnscu&""
- ''-------------------------获得文件类型
- filetype=file.filename
- i=InStrRev(filetype,".")
- l=Len(filetype)
- If i>0 Then
- filetype=Right(filetype,l-i+1)
- End If
- ''-------------------------限制文件类型
- filetype=LCase(filetype)
- filetype=Replace(filetype,".","")
- filetype=CStr(filetype)
- If InStr(rsallowedfile,filetype)=0 Then response.Redirect"err.asp?id=2&nais="&nais&"&cnscu="&cnscu&""
- ''----------------取得新文件名
- If rsnamekind=1 Then
- fname=file.filename
- Else
- RANDOMIZE
- sjs=INT((99-00+1)*RND+00)
- fname=year(date)&month(date)&day(date)&hour(time())&minute(time())&second(time())&sjs
- fname=fname&"."&filetype
- End if
- ''-------------------------检验文件是否存在
- If rsforceup="F" then
- sq1="select * from data where filesize='"&size&"'"
- Set Rs1 = Server.CreateObject("Adodb.Recordset")
- rs1.open sq1,conn,1,2
- If Not rs1.bof Or Not rs1.eof Then response.Redirect"errs.asp?ltid="<id&"&nais="&nais&"&id=4&size="&size&"&cnscu="&cnscu&""
- Else
- sq1="select * from data where filesize='"&size&"'"
- Set Rs1 = Server.CreateObject("Adodb.Recordset")
- rs1.open sq1,conn,1,2
- End If
- ''--------------------------
- if file.filesize>0 then ''如果 FileSize > 0 说明有文件数据
- file.SaveAs fullpath&fname ''保存文件
- iCount=iCount+1
- msg="文件上传成功!"
- End If
- datadir=formPath&fname
- addtime=date()
- rs1.addnew
- rs1("dataname")=fname
- rs1("title")=title
- rs1("explain")=explain
- rs1("datadir")=datadir
- rs1("addtime")=addtime
- rs1("filesize")=size
- rs1("addid")=addid
- rs1.update
- rs1.close
- set file=nothing
- next
- set upload=nothing '删除此对象
- %>
- <card title="上传成功"><p>
- <%
- size=CStr(size)
- sq2="select * from data where filesize='"&size&"' order by id desc"
- Set Rs2 = Server.CreateObject("Adodb.Recordset")
- rs2.open sq2,conn,1,2
- id=rs2("id")
- title=rs2("title")
- explain=rs2("explain")
- size=rs2("filesize")
- addtime=rs2("addtime")
- %>
- <%
- filetype=rs2("dataname")
- i=InStrRev(filetype,".")
- l=Len(filetype)
- If i>0 Then
- filetype=Right(filetype,l-i)
- End If%>
- 格式:<%=filetype%><br/>
- <%size=Round(rs2("filesize")/1024,2)
- If Left(size,1)="." Then size="0"&size%>
- 大小:<%=size%>KB
- <%
- if filetype="gif" or filetype="jpg" or filetype="png" or filetype="bmp" or filetype="jpge" then
- wjss="(img)/down/"&rs2("dataname")&"(/img)"
- else
- wjss="(url=/down/"&rs2("dataname")&")免费下载(/url)"
- end if
- %>
- <br/>文件上传成功,<br/>
- 标题:<input name="ltbt" emptyok="true" maxlength="16" value=""/><br/>
- 内容:<input name="lttxt" emptyok="true" value=""/><br/>
- <anchor title="确定提交">[确定提交]
- <go href="lt_addcl.asp?cnscu=<%=cnscu%>&ltid=<%=ltid%>&dj=<%=dj%>" method="post" accept-charset='utf-8'>
- <postfield name="ltbt" value="$(ltbt)"/>
- <postfield name="lttxt" value="$(lttxt)[br]<%=wjss%>"/>
- <postfield name="djjg" value="$(djjg)"/>
- <postfield name="ldid" value="$(ldid)"/>
- <postfield name="t" value="<%=t%>"/>
- </go>
- </anchor><br/>
- <a href="lt_list.asp?ltid=<%=ltid%>&cnscu=<%=cnscu%>">回到论坛</a><br/>
- <a href="index.asp?cnscu=<%=cnscu%>">社区首页</a>
- </p>
- </card>
- </wml>
- <%rs2.close
- Set rs2=nothing%>