Re: Can't Access Image Above Project Root
- From: "Rik Wasmus" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 18:07:12 +0100
On Mon, 25 Feb 2008 17:54:26 +0100, pbd22 <dushkin@xxxxxxxxx> wrote:
Thanks Rik.
Well, I think the idea is to use "relative paths".
Well, duh.
The browser is an
application that will be loaded on several servers at various
locations so, its better to do something like "../path/to/image.jpg"
than use a URL or and IP which changes from box to box.
Yes, but if a page is http://project.example.com/index.html, having a relative URL like '../images/foo.jpg' doesn't do you any good, as allthough it may seem a valid path on the server, a browser doesn't request relative urls from the server, it translates them and uses a fully qualified url. In the example, there is no path above http://project.example.com... Would you have had http://www.example.com/foo/bar.html, with a src attribute like '../images/foz.jpg', the browser requests 'http://www.example.com/images/foz.jpg', NOT '../images/foz.jpg'.
What's the URL of the actual page you are watching?
So, havening said that, the URL (not public) is http://www.domain.com/presentation.aspx
example.com is reserved for those purposes. Here, from s browsers point of view, there is clearly no path above it.
And, inside presentation.aspx is an iframe that has src=slides.htm.
Inside slides.html is the image tag that looks for an image in a
sibling folder to the root folder.
url should be a valid 'path' considered from the browsers point of view, NOT the servers.
I think I am doing that correctly. And, as far as i understand, the
below image:
<img src="../folder/image.jpg" alt="img" />
should expose an image in a folder named "folder" that is a sibling to
the web site's root folder.
Nope, you can't go outside the root folder (you can offcourse serve files outside the root folder using some scripts on the server, that's beside the point though), the browser MUST have a 'reachable' destination. The browser doesn't know lick about your filesystem, and can't examine it. Having the path 'http://www.example.com/', there's no logical way a browser can select a directory above that, or even guess at how to access it.
--
Rik Wasmus
.
- References:
- Can't Access Image Above Project Root
- From: pbd22
- Re: Can't Access Image Above Project Root
- From: Rik Wasmus
- Re: Can't Access Image Above Project Root
- From: pbd22
- Can't Access Image Above Project Root
- Prev by Date: Re: Can't Access Image Above Project Root
- Next by Date: Re: How to download/save a video clip?
- Previous by thread: Re: Can't Access Image Above Project Root
- Next by thread: help with firefox issue
- Index(es):
Relevant Pages
|