help hiding image paths

M

mark | r

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?

anyone help me?
mark
 
R

Roland Hall

:
: 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
%>

--
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
 
M

mark | r

Roland Hall said:
:
: 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
%>

--
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

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?

Mark
 
R

Roland Hall

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
 
A

Aaron Bertrand [SQL Server MVP]

Set ctrl = server.createobject("GflAx.GflAx")

What DLL is this? Where did you get it?
 
R

Roland Hall

"Duane Jackson" wrote in message : Aaron Bertrand [SQL Server MVP] wrote:
: >>Set ctrl = server.createobject("GflAx.GflAx")
: >
: > What DLL is this? Where did you get it?
: >
: Sorry, I should have said...It's a free dll, http://www.xnview.com/ or
: http://perso.wanadoo.fr/pierre.g/xnview/engfl.html

It probably won't do you much good if your site is hosted.

--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top