Relative Filenames

There are two types of filenames; one you are probably already familiar with which gives the exact position of the file being pointed to, e.g. C:\Windows\Help\Display.hlp. The other is called a relative filename. In this method, the position of a file is given relative to that of the file pointing to it. For example, if the file C:\Website\home.html wanted to show a picture names C:\Website\images\box.gif it would use the filename images\box.gif. The relative filename is effectively the difference between the two filenames.

If while you were developing a web page a graphic you wanted to use was stored as C:\Website\images\box.gif and you used this filename in the web page, when another person looked at your page their browser would try to find the file C:\Website\images\box.gif on their computer even if you had placed this file on your web site, and would probably fail. To rectify this, it is normally advisable to use relative filenames as they will still work when you upload your pages. The one case where you should use an absolute filename is if you know that the person viewing your pages has that file on their system as this will save them time downloading it from your site.