?? readdoc.asp
字號:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<%
'從數據庫中讀取在線編輯的文件數據
docid = Request.querystring("docid")
Dim RS
Set RS = Server.CreateObject("ADODB.Recordset")
if docid <> "" then
RS.Open "files", conn, adOpenStatic, adLockReadOnly 'open static for search,read only
RS.Find "fid=" & docid
If Not RS.EOF THEN
FileSize = RS("fcontent").ActualSize
Response.AddHeader "Content-Disposition","attachment; filename=" & RS("fname")
Response.AddHeader "Content-Length","" & FileSize
readBytes = 0
ReadSize = 10240
Do While readBytes < FileSize
Response.BinaryWrite(RS("fcontent").GetChunk(ReadSize))
Response.Flush()
readBytes = readBytes + ReadSize
Loop
end if
ELSE
docid = Request.querystring("tid")
RS.Open "templates", conn, adOpenStatic, adLockReadOnly 'open static for search,read only
RS.Find "tid=" & docid
If Not RS.EOF THEN
FileSize = RS("tcontent").ActualSize
Response.AddHeader "Content-Disposition","attachment; filename=" & RS("tname")
Response.AddHeader "Content-Length","" & FileSize
readBytes = 0
ReadSize = 10240
Do While readBytes < FileSize
Response.BinaryWrite(RS("tcontent").GetChunk(ReadSize))
Response.Flush()
readBytes = readBytes + ReadSize
Loop
END IF
end if
RS.Close
Set Rs= Nothing
Closeconn()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -