help hiding image paths

Discussion in 'ASP General' started by mark | r, Jul 4, 2005.

  1. mark | r

    mark | r Guest

    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
    mark | r, Jul 4, 2005
    #1
    1. Advertising

  2. mark | r

    Roland Hall Guest

    "mark | r" <> wrote in message
    news:42c8fcb9$0$19707$...
    :
    : 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
    Roland Hall, Jul 4, 2005
    #2
    1. Advertising

  3. mark | r

    mark | r Guest

    "Roland Hall" <nobody@nowhere> wrote in message
    news:...
    >
    >
    > "mark | r" <> wrote in message
    > news:42c8fcb9$0$19707$...
    > :
    > : 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
    mark | r, Jul 4, 2005
    #3
  4. mark | r

    Roland Hall Guest

    "mark | r" wrote in message
    news:42c95f7a$0$12876$...
    : "Roland Hall" <nobody@nowhere> wrote in message
    : news:...
    : >
    : >
    : > "mark | r" <> wrote in message
    : > news:42c8fcb9$0$19707$...
    : > :
    : > : 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
    Roland Hall, Jul 5, 2005
    #4
  5. mark | r

    Bullschmidt Guest

    Bullschmidt, Jul 5, 2005
    #5
  6. Aaron Bertrand [SQL Server MVP], Jul 6, 2005
    #6
  7. > Set ctrl = server.createobject("GflAx.GflAx")

    What DLL is this? Where did you get it?
    Aaron Bertrand [SQL Server MVP], Jul 6, 2005
    #7
  8. mark | r

    Roland Hall Guest

    "Duane Jackson" wrote in message news:...
    : 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
    Roland Hall, Jul 8, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Noah
    Replies:
    5
    Views:
    777
  2. ksamdev
    Replies:
    27
    Views:
    989
    ksamdev
    Dec 15, 2008
  3. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    187
    David Vallner
    Nov 7, 2006
  4. William Starr Moake

    image file paths

    William Starr Moake, Apr 7, 2004, in forum: Javascript
    Replies:
    3
    Views:
    103
  5. Ste
    Replies:
    41
    Views:
    803
    Thomas 'PointedEars' Lahn
    Aug 1, 2007
Loading...

Share This Page