opendoc.asp

来自「一套石油公司内部的运营管理系统」· ASP 代码 · 共 30 行

ASP
30
字号
<!--#include virtual="/include/DBCon.inc"-->
<%
Function SetForDisplay(field, contentType)
	contentType = LCase(trim(contentType))
	nFieldSize = field.ActualSize
	bytes = field.GetChunk(nFieldSize)
	Session("Bytes") = bytes
	Session("Type") = contentType
End Function
%>

<%
   sql = "select * from oil.oil_file where file_id=" & request("ID")
   Set oRS = Server.CreateObject("ADODB.Recordset")
   oRS.CursorLocation = 3
   oRS.Open sql, conn     
   SetForDisplay oRS("file_blob"), "application/msword"
   Set oRS.ActiveConnection = Nothing
%>
<% 
    response.Expires = 0
    response.Buffer  = True
    response.Clear
    response.contentType = Session("Type")
    response.BinaryWrite Session("Bytes")
    Session("Type") = ""
    Session("Bytes") = ""
    response.End
%>
<!--#include virtual="/include/DBClose.inc"-->

⌨️ 快捷键说明

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