Images in higher level directory

Discussion in 'HTML' started by Iain, Oct 16, 2006.

  1. Iain

    Iain Guest

    Hi All

    I want to store various objects at a level higher than wwwroot.

    Is this possible
    I have the following test html program

    <html>
    <head>
    </head>
    <body>
    <img src = "..//Images//testimage.jpg" width = "300" height =
    "300"/>
    </body>
    </html>

    and the image is not displayed although the proerties of the image
    appear to be correct
    ie they point to the correct directory

    Thanks in advance for any help offered

    Iain
    Iain, Oct 16, 2006
    #1
    1. Advertising

  2. Iain

    Dylan Parry Guest

    Iain wrote:

    > I want to store various objects at a level higher than wwwroot.


    Any file stored higher than the root will not be visible (or indeed
    usable) to the public. The only way to get around this is to write a
    script to dynamically write the contents of these files to a stream that
    can be accessed from the public side.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    Programming, n: A pastime similar to banging one's head
    against a wall, but with fewer opportunities for reward.
    Dylan Parry, Oct 16, 2006
    #2
    1. Advertising

  3. Iain wrote:

    > I want to store various objects at a level higher than wwwroot.


    If the file is in a directory higher then the web root, then it can't be
    accessed directly. Relative URLs are converted to absolute URLs, and ".."s
    start to be ignored once you reach the webroot.


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 16, 2006
    #3
  4. Iain

    Nico Schuyt Guest

    Iain wrote:
    > I want to store various objects at a level higher than wwwroot.


    Why??
    (If you try to protect the images, that won't help you :)

    --
    Nico Schuyt
    http://www.nicoschuyt.nl/
    Nico Schuyt, Oct 16, 2006
    #4
  5. Iain

    Andy Dingley Guest

    Iain wrote:

    > I want to store various objects at a level higher than wwwroot.


    Then a secure web server should make damn well sure they can't be
    accessed from there.

    (read the docs and discussion on web server config and security issues)
    Andy Dingley, Oct 16, 2006
    #5
  6. Iain wrote:
    > Hi All
    >
    > I want to store various objects at a level higher than wwwroot.
    >
    > Is this possible
    > I have the following test html program
    >
    > <html>
    > <head>
    > </head>
    > <body>
    > <img src = "..//Images//testimage.jpg" width = "300" height =
    > "300"/>


    What are the double slashes for?

    > </body>
    > </html>
    >
    > and the image is not displayed although the proerties of the image
    > appear to be correct


    Thank goodness. If URLs with ".." gave clients access higher than the
    web root, clients would be able to access any file on the same drive
    (unless access permissions were set with the greatest care, but that's
    an immense burden and concern).

    What you're supposed to do if you want a web site to include files in a
    directory not under the web root is to create a virtual directory under
    the web site in IIS (you mention wwwroot, so I assume you're talking
    about IIS) that points to that physical directory so that, for example,

    http://mysite.example.invalid/images/

    points to your directory c:\mywebimages. Then

    <img src="/images/x.gif">

    will deliver c:\mywebimages\x.gif.

    > ie they point to the correct directory
    Harlan Messinger, Oct 16, 2006
    #6
  7. Iain

    richard Guest

    "Iain" <> wrote in message
    news:...
    > Hi All
    >
    > I want to store various objects at a level higher than wwwroot.
    >
    > Is this possible
    > I have the following test html program
    >


    Your host determines what is the highest level at which you have access.
    If you try that method, you'll most like get an error stating "access
    denied".
    richard, Oct 17, 2006
    #7
  8. Iain

    John Dunlop Guest

    John Dunlop, Oct 17, 2006
    #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. Nathan Sokalski
    Replies:
    0
    Views:
    716
    Nathan Sokalski
    May 30, 2005
  2. Thomas Guettler

    Emacs mode: Display higher level

    Thomas Guettler, Nov 5, 2003, in forum: Python
    Replies:
    2
    Views:
    347
    Steve Evans
    Nov 6, 2003
  3. pabbu
    Replies:
    8
    Views:
    706
    Marc Boyer
    Nov 7, 2005
  4. Nathan Huesken
    Replies:
    0
    Views:
    256
    Nathan Huesken
    Jun 25, 2010
  5. Nathan Sokalski
    Replies:
    0
    Views:
    180
    Nathan Sokalski
    May 30, 2005
Loading...

Share This Page