Demonstrates using the ISYSImageCache object from your web site.
Global.asa
<%
Sub Application_OnStart
Set Application("ISYS") = Server.CreateObject("ISYS.ISYSAsp")
Set Application("ISYSImageCache") = Server.CreateObject("ISYS.ISYSImageCache")
End Sub
%> Document View
<%
Set Display = Document.Display
Display.Option(doBeforeHitByTerm) = "<span style=""color: %FGCOLOR%; background-color: %BGCOLOR%"">"
Display.Option(doBeforeFirstHitByTerm) = Display.Option(doBeforeHitByTerm)
Display.Option(doAfterHitByTerm) = "</span>"
Display.Option(doAfterLastHitByTerm) = Display.Option(doAfterHitByTerm)
Application("ISYSImageCache").Prepare Document, Array(Request("Results"), Request("Doc"))
Display.Option(doImageUrl) = "resource.asp?Results=" & Request("Results") & _
"&Doc=" & Request("Doc") & _
"&Resource="
Display.Stream Response
%>
Resource.asp
<%
Key = Array(Request("Results"), Request("Doc"))
ImageData = Application("ISYSImageCache").Fetch (Key, Request("resource"))
Response.Clear
ImageType = LCase(Right(Request("resource"), 3))
If ImageType = "jpg" Then
Response.ContentType = "image/jpeg"
ElseIf ImageType = "gif" Then
Response.ContentType = "image/gif"
Else
Response.ContentType = "image/" + ImageType
End If
Response.BinaryWrite ImageData
Response.End
%>
|