⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendfileindb.asp

📁 公文下发和上报管理:   在发布和上报文件时
💻 ASP
字号:

<!--#include file="asp/opendb.asp"-->
<!--#include file="asp/top.asp"-->
<!--#include file="asp/checkuser.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
<title></title>
</head>
<body bgcolor="#eeeeee" topmargin="5" leftmargin="0">
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then

	function makefilename(fname)
		fname = now()
		fname = replace(fname,"-","")
		fname = replace(fname," ","") 
		fname = replace(fname,":","")
		fname = replace(fname,"PM","")
		fname = replace(fname,"AM","")
		fname = replace(fname,"上午","")
		fname = replace(fname,"下午","")
		makefilename=fname
	end function 
	
	vfname = makefilename(now())
	
	set conn=opendb("oabusy","conn","accessdsn")

	set xup = Server.CreateObject("Xionsoft.XionFileUpLoad")

	if xup.FileCount <1 then
		Response.Write "请选择要上传的文件"
		Response.Write	"<a href=fbfile.asp>返回</a>"	
		Response.End 
	end if
	
	filename1=xup.FileName("file1") 

	if lcase(right(filename1,4))<>".pdf"   then

		Response.Write "必须上传是PDF,您上传的是:"&lcase(right(filename1,4))
		Response.Write	"<a href=fbfile.asp>返回</a>"
		Response.End 
	end if

	if xup.FileSize("file1")>4000000 then
		Response.Write "文档超大,必须小于4000000字节"
		Response.Write	"<a href=fbfile.asp>返回</a>"
		Response.End 
	end if

	for i=1 to xup.ItemCount 
		if xup.ItemName(i)="title" then title=xup.ItemValue(i)
		if xup.ItemName(i)="fbdw" then fbdw=xup.ItemValue(i)
		if xup.ItemName(i)="dfdw" then dfdw=xup.ItemValue(i)
		if xup.ItemName(i)="df" then df=xup.ItemValue(i)
		if xup.ItemName(i)="joinman" then joinman=xup.ItemValue(i)
		if xup.ItemName(i)="filename" then filename=xup.ItemValue(i)
	next
	
	set rs=server.createobject("ADODB.recordset") 
	sql="select * from path"
	rs.open sql,conn,1,1
	
	if not rs.eof and not rs.bof then
		filepath=rs("fileword")
	else
		filepath="upfile/"
	end if
	rs.close

	sql = "select * from filedata"
	rs.Open sql,conn,1,3
	rs.addnew 

	 if instr(1,"||supermanage|chksuper|",oabusyuserpower)>1   then
	    if dfdw<>"" then
			rs("fbdw")=df
			rs("manageman")=dfdw
		else
			rs("fbdw")=fbdw
			rs("manageman")=oabusyusername
		end if
	else
		rs("fbdw")=fbdw
		rs("manageman")=oabusyusername
	end if
	
	rs("title")=title
	rs("typename")=filename
	if instr(joinman,rs("manageman")) then 
		joinman=joinman&"|"
	else
		joinman="|"&rs("manageman")&joinman&"|"
	end if
	rs("joinman")=joinman
	rs("jointime")=now()
	rs("filepath")=filepath
	rs("filename")=vfname&filename1
	rs.update 
	id=rs("id")
	rs.close 
	
	if filename1<>"" then xup.SaveFile "file1",filepath&vfname&filename1

	set xup=nothing

	sql="select * from fileuser"
	rs.Open sql,conn,1,3
	mysendto=split(joinman,"|",-1,1)
	
	for each sendtoinf in mysendto
		if trim(sendtoinf)<>"" then
			set rs1=server.createobject("ADODB.recordset") 
			sql="select * from userinf  where username='"&trim(sendtoinf)&"'"
			rs1.Open sql,conn,1,1
			rs.addnew
			rs("username")=sendtoinf
			if not rs1.EOF then  rs("name")=rs1("name")
			rs("qshou")=0
			rs("reid")=id
			rs("title")=title
			rs.update
			rs1.Close
			set rs1=nothing
		end if
	next
	rs.close
	set rs=nothing
	set conn=nothing 

%>
<br><br>
<center>发送完成</center><a href="fbfile.asp">返回</a>
<%
end if
%>
</body>  
  </html><!--#include file="footer.htm"-->


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -