
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="cache-control" content="private">
<meta http-equiv="cache-control" content="max-age=0, must-revalidate">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="expires" content="now-1">
<meta http-equiv="pragma" content="no-cache">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005, 2006 Roderick Divilbiss">
<title>Protect Image</title>
<style>
<!--
#protect {
/* http://www.rodsdot.com/ee/streamImage.asp */
background-image: url('streamImage.asp');
background-repeat: no-repeat
}
#foreground {
/* set to 10 for demo, use 0 in production. */
filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;
}
-->
</style>
</head>
<body>
<div id="protect"><img id="foreground" border="0" src="images/protect.gif"></div>
</body>
</html>
streamImage.asp
<%
'
if Request.ServerVariables("HTTP_REFERER")="http://www.rodsdot.com/ee/protectImage.htm" then
img = "/images/somerights20.gif"
else
img = "/ee/images/protect.gif"
end if
' no browser caching of this page !! to be used on all pages
Response.Expires=-1
Response.ExpiresAbsolute = Now() - 1
' do not allow proxy servers to cache this page !! to be used on all pages
Response.CacheControl="private"
Response.CacheControl="no-cache"
Response.CacheControl="no-store"
Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
'Open a image file
objStream.Type = 1 ' adTypeBinary
objStream.Open
objStream.LoadFromFile Server.MapPath(img)
'Output the contents of the stream object
Response.ContentType = "image/gif"
'Response.ContentType = "image/jpeg"
Response.BinaryWrite objStream.Read
%>