把檔案存進access資料庫然後取出來供人下載的代碼

來源:互聯網
上載者:User
access|資料|資料庫|下載 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



相關文章

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。