RSS
热门关键字:  google  网站  电子书籍  电子杂志  网赚
当前位置 : 主页>>网络服务>>网站知识>>列表

Access数据库实现文件存取

来源: 作者:vimhoo 时间:2007-12-30 点击:
senddate.asp(发送界面)

〈form method="post" ENCTYPE="multipart/form-data" name="form3" action="senddateindb.asp"〉
〈input type="hidden" name="userdept" value="〈%=firstdept%〉"〉
〈input type="hidden" name="username" value="所有人"〉
〈td align="center"〉〈b〉发给:〈/b〉〈/td〉〈td〉〈input type="text" name="sendto" size=60 value="〈%=sendto%〉" onfocus="document.form3.title.focus();"〉〈font color=red〉*〈/font〉〈/td〉
〈/tr〉
〈tr〉
〈td align="center"〉〈b〉标题:〈/b〉〈/td〉
〈td〉〈input type=text name="title" size=60〉〈font color=red〉*〈/font〉〈/td〉
〈/tr〉
〈tr〉
〈td align="center"〉〈b〉内容:〈/b〉〈/td〉
〈td〉〈textarea name="content" rows="9" cols="60"〉〈/textarea〉〈/td〉
〈/tr〉
〈tr〉
〈td align="center"〉〈b〉附件:〈/b〉〈/td〉
〈td〉〈input type="file" name="file1" size=35〉(不能超过100K)〈/td〉
〈/tr〉
〈tr〉
〈td align=center colspan=2〉
〈input type="submit" name="submit" value="发送"〉
〈/td〉
〈/form〉

*************************************************************************
senddateindb.asp(把要发送的文件保存到数据库)

〈!--#INCLUDE FILE="asp/fupload.inc"--〉
〈!--#include file="asp/opendb.asp"--〉
〈!--#include file="asp/sqlstr.asp"--〉
〈!--#include file="asp/checked.asp"--〉
〈!--#include file="asp/bgsub.asp"--〉
〈%
'On Error Resume Next
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then response.redirect "default.asp"
%〉
〈html〉
〈head〉
〈meta http-equiv="Content-Type" content="text/html; charset=gb2312"〉
〈meta name="GENERATOR" content="Microsoft FrontPage 4.0"〉
〈meta name="ProgId" content="FrontPage.Editor.Document"〉
〈link rel="stylesheet" href="css/css.css"〉
〈title〉企业管理系统〈/title〉
〈/head〉
〈body bgcolor="#eeeeee" topmargin="5" leftmargin="5"〉
〈%
call bghead()
%〉
〈center〉
〈table〉
〈tr〉
〈td〉
〈b〉公文发送〈/b〉
〈/td〉
〈form action="senddate.asp" method="post" name="form1"〉
〈td〉
〈input type="submit" value="返回"〉
〈/td〉
〈/form〉
〈/tr〉
〈/table〉
〈/center〉
〈%
call bgmid()
%〉

〈%
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'---------------------------
'response.write "开始发送〈br〉"
'---------------------------
Dim Fields
UploadSizeLimit=100000
Set Fields = GetUpload()
dim Field
For Each Field In Fields.Items
if Field.name="title" then title=BinaryToString(Field.value)
if Field.name="content" then content=BinaryToString(Field.value)
if Field.name="sendto" then sendto=BinaryToString(Field.value)
if Field.name="file1" then
filename=field.FileName
fileContentType=field.ContentType
filevalue=field.value
end if
next
'--------------------------------------
'response.write "title=" & title & "〈br〉"
'response.write "content=" & content & "〈br〉"
'response.write "sendto=" & sendto & "〈br〉"
'response.write "filedname=" & filename & "〈br〉"
'response.write "fileContentType=" & fileContentType & "〈br〉"
'----------------------------------------
dim mysendto
mysendto=split(sendto,"|",-1,1)
for each sendtoinf in mysendto
userdeptpoint=InStr(sendtoinf,":")
if userdeptpoint〉0 then
sendtoinflen=len(sendtoinf)
recipientusername=right(sendtoinf,sendtoinflen-userdeptpoint)
if recipientusername="所有人" then
recipientusername="所有人"
else
usernamepoint=Instr(recipientusername,"(")
usernamelen=len(recipientusername)
recipientusername=left(recipientusername,usernamelen-1)
recipientusername=right(recipientusername,usernamelen-1-usernamepoint)
end if
recipientuserdept=left(sendtoinf,userdeptpoint-1)
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("ADODB.recordset")
sql = "select * from senddate"
共2页: 上一页 1 [2] 下一页
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册