upload 5xsoft.inc asp利用文件上传组件upload_5xsoft文件上传

我们是利用upload文件上传组件进行文件上传哦。

<%Server.ScriptTimeOut=5000%>
<!--#include file="conn.asp"-->
<!--#include FILE="upload_5xsoft.inc"-->
<html>
<head>
<title>文件上传</title>
<link rel="stylesheet" href="<%=css%>" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<%dim upload,file,formName,formPath,iCount,exeec,wjm
set upload=new upload_5xsoft
formPath="FJ/"

ly=upload.form("content")
yhm=upload.form("yhm")
zid=upload.form("zid")
ys=upload.form("ys")
yyzm = upload.form("yzm")
zt=upload.form("zt")
ztid=upload.form("ztid")
cz=upload.form("cz")
tp=upload.form("tp")
if tp = "http://" then tp = ""
ly=xrzh(ly)

if cz = "" then
fhlj = "bbs_list.asp?zid="&zid
else
fhlj = "bbs_tj.asp?page=1000&zt="&zt&"&ztid="&ztid&"&zid="&zid
zid = ztid
end if

if yyzm <> session(sessionvalue & "yzm") then redirect fhlj

zhhf = jdsj
if yhm = "" then yhm = "游客"''request.servervariables("remote_addr")

for each formName in upload.objFile ''列出所有上传了的文件
set file = upload.file(formName)
if file.FileSize>0 then
kzm = lcase(right(file.filename,4))
if instr(",.mpg.asf.avi.mp3.swf.mpeg.png.gif.bmp.jpg.wma.wmv.txt",kzm)<= 0 then response.Redirect hflj
if file.filesize > 819200 then%>
<script language="javascript">
alert("文件大于800k!");
window.location="<%=fhlj%>";
</script>
<%end if
wjdx = file.filesize
wjm = formpath&replace(cstr(date),"-","") & cstr(Replace(Timer(), ".", "")) & kzm
file.SaveAs Server.mappath(wjm)
dx = cstr(file.filesize/1024)
if len(dx) >6 then dx=left(dx,6)
end if
next
if trim(zt) <>"" then
sql = "select * from yrwl_tb_lt order by id desc"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if sjk <> "" then
if rs.eof then
id = "1"
else
id = cstr(rs("id")+1)
end if
end if
rs.addnew
if sjk = "" then
if rs.eof then
id = "1"
else
id = cstr(rs("id"))
end if
end if
rs("yhm") = yhm

rs("zt") = zt
rs("ly") = ly

if wjm = "" and tp <> "" then wjm = tp
rs("fj") = wjm
rs("dx") = dx
rs("dj") = 0
rs("zd") = "5"
rs("hf") = 0
if cz = "" then
rs("zid") = "s"
rs("zhhf") = jdsj & " "&yhm
rs("lb") = zid
else
rs("zid") = zid
sql = "select * from yrwl_tb_lt where id=" & zid
set rs1 = server.createobject("adodb.recordset")
rs1.open sql,conn,1,3
rs1("zhhf") = jdsj & " "&yhm
rs1.update
rs1.close
end if

rs("sj") = jdsj
rs.update
rs.close

if instr(yhm,".") = 0 and yhm <> "游客" then
exec="select * from yrwl_tb_admin where yhm='"&yhm&"'"
rs.open exec,conn,3,3
cs = rs("cs")
qm = rs("qm")
if isnull(cs) then cs = 0
if cs="" then cs=0
exec="update yrwl_tb_admin set cs=" & cstr( cs + 3 ) & " where yhm='" & yhm & "'"
conn.execute exec
end if

upload 5xsoft.inc asp利用文件上传组件upload_5xsoft文件上传

if cz = "" then
''读文件
if wjm <> "" then
kzm = lcase(right(wjm,3))
if instr(wjm,"http") = 0 then wjm = "../" & wjm
xswjm = gqzh(wjm)
if len(wjm)>4 and instr(wjm,"FJ")>0 then
tpxs = xswjm & "<br>附件下载:<a href=" & wjm & " target=_blank>[" & wjm &"]</a>"
else
tpxs = xswjm
end if
if tpxs = "" or (instr(wjm,"swf")>0) then tpxs = "<iframe id=kj name=kj frameborder=0 width=100% height=500 src="&wjm&"></iframe>"
end if

set fso = Server.Createobject("Scripting.FileSystemObject")
set file=fso.opentextfile(Server.mappath("tbtb.txt"),1,False)
do while file.AtEndOfStream<>true
wjnr = wjnr & file.ReadLine() & chr(13)
loop
file.close
set file = nothing
set fso = nothing
if isnull(qm) then qm = ""
ly = replace(ly,chr(13),"<br>")
wjnr = replace(wjnr,"$ti$",zt)
wjnr = replace(wjnr,"$sj$",jdsj)
wjnr = replace(wjnr,"$zt$", kill_keyword(zt))
wjnr = replace(wjnr,"$ly$", kill_keyword(ly) & "<br>" & tpxs & "--------------------------------------<Br> 个性签名:<a title="&qm&">"&qm&"</a>")
wjnr = replace(wjnr,"$zid$",zid)
wjnr = replace(wjnr,"$qm$",qm)
wjnr = replace(wjnr,"$ztid$",id)

if instr(yhm,".")>0 then yhm=left(yhm,instrrev(yhm,"."))&"*"
wjnr = replace(wjnr,"$fyr$",yhm)
wjnr = replace(wjnr,"$lxfs$",session(sessionvalue & "lxfs"))
''写文件
wj = Server.mappath( "tb/" & id & ".htm" )
set myfileobject=server.CreateObject("Scripting.FileSystemObject")
set mytextfile=myfileobject.CreateTextFile(wj)
mytextfile.WriteLine wjnr
mytextfile.close
end if

set file=nothing
set upload=nothing ''删除此对象
end if
conn.close
response.redirect fhlj%>
</body>
</html>

  

爱华网本文地址 » http://www.aihuau.com/a/8105090103/334255.html

更多阅读

iOS8 AirDrop怎么用 airdrop怎么打开

iOS8 AirDrop怎么用——简介AirDrop 是苹果在 iOS7 系统中推出的一个新功能,利用手机上的低功耗蓝牙来传输文件。当然在 iOS8 上也可以使用 AirDrop 功能,与他人分享照片,文件等。下面简单介绍下怎么在 iOS8 上使用 AirDrop 的操作方法

怎样对一个文件夹加密 如何加密电脑文件夹

怎样对一个文件夹加密——简介电脑如今越来越普及,在方便自己的同时也给别人提供了方便。但有时候出于隐私的关系,我们的文件并不想让他人看到,就需要给文件隐身加密,那么怎样对一个文件夹加密呢?请跟我一起来看一看我平时所用的三种方法

nero8.0如何刻录dvd光盘 nero8刻录dvd视频光盘

现在的刻录工具非常多,哪一款比较适合自己,哪一款是最好的刻录软件!在选择上会比较纠结!那nero8.0,狸窝刻录工具都是如何刻录dvd光盘的?让我们看看吧!一、nero8.0刻录一张视频光盘点击“翻录和刻录”面板中的“刻录视频光盘”:如图进入视频

声明:《upload 5xsoft.inc asp利用文件上传组件upload_5xsoft文件上传》为网友河畔三分沉酣分享!如侵犯到您的合法权益请联系我们删除