Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > help hiding image paths

Reply
Thread Tools

help hiding image paths

 
 
mark | r
Guest
Posts: n/a
 
      07-04-2005


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




 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      07-04-2005
"mark | r" <(E-Mail Removed)> wrote in message
news:42c8fcb9$0$19707$(E-Mail Removed) ...
:
: 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


 
Reply With Quote
 
 
 
 
mark | r
Guest
Posts: n/a
 
      07-04-2005



"Roland Hall" <nobody@nowhere> wrote in message
news:(E-Mail Removed)...
>
>
> "mark | r" <(E-Mail Removed)> wrote in message
> news:42c8fcb9$0$19707$(E-Mail Removed) ...
> :
> : 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




 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      07-05-2005
"mark | r" wrote in message
news:42c95f7a$0$12876$(E-Mail Removed) ...
: "Roland Hall" <nobody@nowhere> wrote in message
: news:(E-Mail Removed)...
: >
: >
: > "mark | r" <(E-Mail Removed)> wrote in message
: > news:42c8fcb9$0$19707$(E-Mail Removed) ...
: > :
: > : 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


 
Reply With Quote
 
Bullschmidt
Guest
Posts: n/a
 
      07-05-2005
And here's a related link:

Serving Dynamic Images from Static Web Pages - 5/24/2000
http://www.4guysfromrolla.com/webtech/052400-1.shtml

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      07-06-2005
http://www.aspfaq.com/2276




> anyone know a useful way of hiding image paths so images on my site cant

be
> directly linked to?



 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      07-06-2005
> Set ctrl = server.createobject("GflAx.GflAx")

What DLL is this? Where did you get it?


 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      07-08-2005
"Duane Jackson" wrote in message news:(E-Mail Removed)...
: 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: BASE and LOCAL paths at the same time? ksamdev HTML 27 12-15-2008 09:36 PM
Script for Hiding/Un-Hiding Text On Click Ste Javascript 41 08-01-2007 02:35 PM
Paths, gentleman, paths Ohad Lutzky Ruby 2 11-07-2006 02:15 AM
image file paths William Starr Moake Javascript 3 04-07-2004 10:55 AM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments