in message
: : >
: >
: > : > :
: > : anyone know a useful way of hiding image paths so images on my site
cant
: > be
: > : directly linked to?
: > : ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg">
: (where
: > : the path starts from
www.domain.com/secretfolder/moo/fred/image01.jpg)
: but
: > : dont know how to set this up
: > :
: > : BTW am on a shared host so dont have the use of base level
: administration
: > if
: > : it makes any difference?
: >
: > You would actually put the folder outside the web root, not beneath it.
: >
: > <%@ Language=VBScript %>
: > <%
: > Option Explicit
: > Response.Buffer = True
: >
: > Function ReadBinaryFile(FileName)
: > Const adTypeBinary = 1
: > Dim BinaryStream
: > Set BinaryStream = CreateObject("ADODB.Stream")
: > BinaryStream.Type = adTypeBinary
: > BinaryStream.Open
: > BinaryStream.LoadFromFile FileName
: > ReadBinaryFile = BinaryStream.Read
: > End Function
: >
: > Const strPath = "c:\images\"
: > dim path, gifdata, file
: > file = "logo.gif"
: > path = strPath & file
: > gifdata = ReadBinaryFile(path)
: > Response.ContentType = "image/gif"
: > Response.Buffer = True
: > Response.Clear
: > Response.BinaryWrite gifdata
: > Response.Flush
: > %>
: >
:
: is that the image.asp file? and i guess i should use response.queystring
to
: get the filename and set the types to jpeg etc?
If it's a link and you're passing the name on the URL, yes, use
Request.QueryString. The ContentType would need to be the appropriate MIME
type for the file being read.
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp