Sie sind auf Seite 1von 1

<!

--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library"
-->
<% on Error resume next %>
<!-- #Include virtual = "/_scriptlibrary/node.asp" -->
<%
sub abort(vInput)
response.flush
response.write vInput
response.status = "302 Moved Temporarily"
'response.AddHeader "Location", "/"
response.end
end sub
'Create a stream object
Dim objStream :
Dim strPath
: strPath = strEmbedContent 'This is from the calling page.
'abort "offline"
varStartItem = request.querystring("Item")
if not isnumeric(varStartItem) or varStartItem = "" then
abort "Bad Request"
else
strPath = "/" & fGetNode(varStartItem)(ordURL, 0)
if not right(lcase(strPath), 4) = ".pdf" then
abort right(strPath,4) & ": Not Supported"
else
'response.flush
Set objStream = Server.CreateObject("ADODB.Stream")
'Open the file
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile server.mappath(strPath)
'Output the contents of the stream object
Response.ContentType = "application/PDF"
Response.BinaryWrite objStream.Read
'Clean up....
objStream.Close
Set objStream = Nothing
response.end
end if
end if
%>

Das könnte Ihnen auch gefallen