📄 fjfileup.asp
字号:
<!--#include file="../Include/TimeOut.asp"-->
<!--#include file="../Include/AdoConn.asp"-->
<!--#include file="../Include/online.asp"-->
<%
'****************处理上传附件部分********************
if session("newstitle")<>"" then'修改状态
set rst=server.CreateObject ("adodb.recordset")
strsql="select 附件号,附件名 from XT_TD_UserMessage where 消息题名='"+session("newstitle")+"' and 发送日期='"&session("senddate")&"'"
rst.Open strsql,conn
fjCode=rst("附件号") '存储数据库中原来附件号
fjName=rst("附件名") '存储数据库中原来附件名
rst.Close
set rst=nothing
end if
set FileUp=server.createobject("ChinaASP.UpLoad")
Path=server.mappath("\news\fj")
dim iCount
iCount=0
txtFileNameAll=fjName '存储存入数据库的新附件名
txtFileName="" '存储当前处理的附件名
for each f in fileup.Files
if f.isempty=false then
Response.Write f.filename
Response.Write "<br>"
if instr(f.filename,".doc")=0 and instr(f.filename,".rar")=0 and instr(f.filename,".zip")=0 then
Response.Redirect("../Messagebox/error.asp?info=附件类型不对,只能是.doc\.ZIP\.RAR文档!")
end if
Randomize
if fjCode="0" then fjCode=cstr(clng(rnd(0)*10000000))
txtFileName=fjCode&"_" & f.filename
if f.filesize<>0 then
else
end if
f.saveas Path & "\" & txtFileName
if instr(fjName,txtFileName)=0 then
txtFileNameAll=txtFileNameAll&"/"&txtFileName
else
txtFileNameAll=fjName'重复上传则不写入数据库
end if
end if
iCount=iCount+1
next
if txtFileNameAll<>"" then
StrSQL="update XT_TD_UserMessage set 附件号='"&fjCode&"',附件名='"&txtFileNameAll&"' where 消息题名='"+session("newstitle")+"' and 发送日期='"&session("senddate")&"'"
conn.Execute StrSQL
end if
session("newstitle")=""
session("sendate")=""
Response.Write "附件上传成功!<br>"
querySQL="select * from XT_VD_usermessage where 发送人编码='"&session("usercode")&"' order by 发送日期 desc "
Response.Write "<a href='news_EditList.asp?strsql="&server.URLEncode(querySQL)&"'>返回列表</a>"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -