Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Images in higher level directory

Reply
Thread Tools

Images in higher level directory

 
 
Iain
Guest
Posts: n/a
 
      10-16-2006
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

 
Reply With Quote
 
 
 
 
Dylan Parry
Guest
Posts: n/a
 
      10-16-2006
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.
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      10-16-2006
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
 
Reply With Quote
 
Nico Schuyt
Guest
Posts: n/a
 
      10-16-2006
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/


 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      10-16-2006

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)

 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      10-16-2006
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

 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      10-16-2006

"Iain" <> wrote in message
news: ups.com...
> 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".

 
Reply With Quote
 
John Dunlop
Guest
Posts: n/a
 
      10-17-2006
Iain:

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


http://httpd.apache.org/docs/2.0/url...g.html#outside

--
Jock

 
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
importing modules from higher level directory Nathan Huesken Python 0 06-25-2010 09:20 PM
c is a low-level language or neither low level nor high level language pabbu C Programming 8 11-07-2005 03:05 PM
Accessing higher security level from higher security level nderose@gmail.com Cisco 0 07-11-2005 10:20 PM
HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory Nathan Sokalski ASP .Net 0 05-29-2005 11:33 PM
HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory Nathan Sokalski ASP .Net Web Controls 0 05-29-2005 11:33 PM



Advertisments