View Full Version : placing files
chechu
01-25-2007, 12:00 PM
How can I place an image that is stored in another map on the server, without placing the whole adress ?
where the page is: img/one/two/three/image.html
where the image is that I need to place in that page: img/one/image.gif
How can I solve that without placing http://www.mysite.com/img/one/image.gif ?
I thought placing .../ would refer to the main file.
jonnyynnoj
01-25-2007, 06:35 PM
../ is used to go back a folder, so i think it would look like this:
../../image.gif
chechu
01-25-2007, 09:10 PM
doesn't work that way.
../../image.gif should indeed work. /img/one/image.gif is always an option too.
jscheuer1
01-25-2007, 09:36 PM
The relative path:
../../image.gif
will work if the image.gif is in the root and the page is, say - here:
/pages/image_pages/page_1.htm
But, that wasn't the question, was it?
/img/one/image.gif
will work in the situation described.
Whenever you start with the ../ stuff (or even paths like these:
img/one/image.gif
without the beginning slash that denotes the root of the domain), it depends upon not only where the image is but, also where the page that is supposed to display the image is in relation to the image. Those ../ things are part of what is called the relative path. If you don't understand relative paths, don't use them.
mburt
01-25-2007, 09:43 PM
This also depends on which level (or directory) of the website you're browsing, it constantly changes :) Once you get a hang of it though, it's easy.
chechu
03-15-2007, 12:46 PM
So if I have the following in the root directory
- img/one/two.gif
- EN/index.html
I need to place in the index .../img/one/two.gif ??
It doesn't work, but maybe it is because I am working offline ?
jscheuer1
03-15-2007, 02:27 PM
So if I have the following in the root directory
- img/one/two.gif
- EN/index.html
I need to place in the index .../img/one/two.gif ??
It doesn't work, but maybe it is because I am working offline ?
Not:
.../img/one/two.gif
Three dots doesn't mean anything, as far as I know. The relative path for this case you described in the above quote would be:
../img/one/two.gif
And, it works locally and live as long as the relative directory structure (not the distance to the root) is the same in both locations. That is the one major advantage of the relative path. One dot (.\) means 'this folder' two dots (..\) means 'one folder closer to the root'.
Of course, all of the other normal things not relating to path must be done correctly as well like, but not limited to:
The files and paths must exist and be named as you describe, case matters.
The HTML code using the image must be valid and to be seen, have attributes and style that allow it to be seen.
chechu
03-15-2007, 04:11 PM
Dear God, a difference of one dot ..........
Now it works indeed. Forgive me my stupidity !
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.