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

📄 fujianpost.asp

📁 本oa系统内部短信.手机短信.文件传输.公文收发.邮件服务.共享下载.内部论坛等功能
💻 ASP
字号:
<%Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<!--#include file="../bbs/upload_5xsoft.inc"-->
<%
Dim levels__MMColParam
levels__MMColParam = "1"
If (Session("names")  <> "") Then 
  levels__MMColParam = Session("names") 
End If
%>
<%
Dim levels
Dim levels_numRows
Set levels = Server.CreateObject("ADODB.Recordset")
levels.ActiveConnection = MM_oavbsconn_STRING
levels.Source = "SELECT 姓名,操作名称  FROM levelssdfgsfgtrgrthe5fgbdnjyu76  WHERE 姓名 = '" + Replace(levels__MMColParam, "'", "''") + "' and 操作名称='管理人事照片与附件'"
levels.CursorType = 0
levels.CursorLocation = 2
levels.LockType = 1
levels.Open()
levels_numRows = 0
%>
<%if not levels.eof or not levels.bof then%>
<%
Dim StartTime,EndTime
StartTime=timer()
%>
<%server.ScriptTimeout=1800%>

<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<%
Server.ScriptTimeout=900
dim upload,file,formName,formPath,iCount,fileformat
set upload=new upload_5xSoft
%>
<%
formPath="../../dataandfiles/files/hr/"&Session("userssdfgfhtrh")&"/"
p1="../../../../dataandfiles/files/hr/"&Session("userssdfgfhtrh")&"/"
manyfolder="../../dataandfiles/files/hr/"
 Dim objFSO11
  Set objFSO11= Server.CreateObject("Scripting.FileSystemObject")
  If  objFSO11.FolderExists(Server.MapPath(manyfolder))   Then   
Else   
objFSO11.CreateFolder(Server.MapPath(manyfolder))
Set objFSO11 = Nothing
End   If   
 Dim objFSO1
  Set objFSO1= Server.CreateObject("Scripting.FileSystemObject")
  If  objFSO1.FolderExists(Server.MapPath(formPath))   Then   
Else   
objFSO1.CreateFolder(Server.MapPath(formPath))
Set objFSO1 = Nothing
End   If %>
<%
 if right(formPath,1)<>"/" then formPath=formPath&"/" 
iCount=0
for each formName in upload.file 
 set file=upload.file(formName)  
fileformat="."&Mid(file.filename,InStrRev(file.filename,".")+1)
	fileformatxz="."&Mid(file.filename,InStrRev(file.filename,".")+1)%>
<!--#include FILE="../gw/ftyepseesrfgtsf.asp"-->
 <%
dim flength,fpath,fname
 if file.FileSize>0 then       
flength=cint(file.FileSize/1024)
fpath=formPath&File.FileName
fname=file.FileName
session("fnames")=fname
Dim datalog__MMColParam '先验证,再上传
datalog__MMColParam = "1"
If (file.FileName  <> "") Then 
datalog__MMColParam = P1&fname 
End If
Dim datalog
Dim datalog_numRows
Set datalog = Server.CreateObject("ADODB.Recordset")
datalog.ActiveConnection = MM_oavbsconn_STRING
datalog.Source = "SELECT *  FROM 电子附件  WHERE 文件路径 = '" + Replace(datalog__MMColParam, "'", "''") + "'"
datalog.CursorType = 0
datalog.CursorLocation = 3
datalog.LockType = 3
datalog.Open()
if not datalog.eof then 
response.write"<script>alert('"&Session("names")&"很抱歉,您上传的"&fname&"文件重名。建议修改文件名继续上传,谢谢!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
  Response.End
  end if
 on error resume next
file.SaveAs Server.mappath(formPath&file.FileName)   ''保存文件
if err.number<>0 then
   	response.write"<script>alert('"&Session("names")&"很抱歉,您上传的文件"&file.FileName&"含有,.;等非法字符,请去掉该类字符继续上传,谢谢!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end()
end if
response.write file.FilePath&file.FileName&" ("&cint(file.FileSize/1024)&"K) => "&formPath&File.FileName&" 成功!<br>"
  iCount=iCount+1
  dim total
total=1
dim ks
ks="k"
%>
<%
do while total<=iCount and datalog.eof 
datalog.addnew
datalog("上传人帐号")=session("userssdfgfhtrh")
datalog("上传人姓名")=session("names")
datalog("上传人部门")=session("bumen")
datalog("用户ID")=session("upuserimgid")
datalog("属性")="电子附件"
datalog("添加时IP")=ip
datalog("文件路径")=P1&fname
datalog("文件名")=fname
datalog("添加日期")=date()
datalog("文件大小")=flength&"KB"
if flength=0 then
flength=1
end if
datalog.update
datalog_numRows = 0
loop
datalog.Close()
Set datalog = Nothing
 end if
set file=nothing
next
set upload=nothing  ''删除此对象
if icount<>0 then
Htmend iCount&" 个文件上传结束!"
else
response.write " 0个文件上传结束,空文件不予以存储!"
end if
sub HtmEnd(Msg)
 set upload=nothing
end sub
%>

<%response.redirect ("addfujian.asp")%>
<%
levels.Close()
Set levels = Nothing
%>
<%else%>
<%
levels.Close()
Set levels = Nothing
%>
<%
response.write"<script>alert('"&Session("names")&"很抱歉,您没有管理人事附件的权限。');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
%>
<%response.end()
end if%>

⌨️ 快捷键说明

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