Directory


#1

ok, I put two files in my directory so far, one is an index page, the other is a jpg picture. I want the picture to show up on my web page. So i put a link < img src = " ftp://d_and_k@darkerkind.com/darkerkind.com/bg.jpg " > minus all the spaces et cetera. The picture isn’t showing up, but theres a box where it should be. So I think the address of the picture is rong. How should I change it? the second darkerkind.com is the name of my directory I’m pretty sure so any help would be really really good!

Thanx!


#2

You shouldn’t use ftp address.
You should use .

Because the picture is in the same directory as your index/html file, you can just put the file name.

If your picture was in a folder called images and your index file stays where it is, you use
If your picture was in images and your index file in documents, you would use . The …/ makes it down ‘down’ a directory.

And you put your files in that darkerkind.com directory.

Just been to your site and you’ve put the index file in the right place so it’s just the image :slight_smile:


#3

You can also use img src=“http://www.domain.com/pictures/picture.jpg” it’s kinda the long way around, but it does make sure that the link works everwhere. Just something I normally do for my pictures, and that doesn’t necessarly mean you shoud too.

-Matttail


#4

Or src="/pictures/picture.jpg" - does the same thing but has far less overhead.


Simon Jessey
Keystone Websites | si-blog


#5

Or src="/pictures/picture.jpg" - does the same thing but has far less overhead.

How is that less overhead? The client has to make another HTTP request for the image either way.


If you want useful replies, ask smart questions.


#6

I would assume less overhead in what you have to type. the reason I use it, is so that regardless of where the file is located in relation to the image it will work. Ie /home/pictures/blog/index.htm can still access the file just the same as if it were located in /home.

-Matttail


#7

If you had multiple servers at your disposal you could separate all the pictures on your site to a separate server and call it something like images.yourdomain.com. You could then use a different http daemon on that subdomain, one that’s better suited for distributing content like images Real Fast. So Apache for the main site, and something like thttpd or lighttpd (or even something dastardly like tux) for the images.yourdomain.com. More efficient use of server resources and all that.

This being a shared hosting, though, such measures aren’t exactly realistic. Or needed.


#8

[quote]Or src="/pictures/picture.jpg" - does the same thing but has far less overhead.

How is that less overhead? The client has to make another HTTP request for the image either way.[/quote]
The first time a request is made on a remote path (the full URL), the IP address must be ascertained by checking the DNS. Since the information is then cached, it is only the first hit that matters, so it isn’t really a big deal.


Simon Jessey
Keystone Websites | si-blog