Hyperlinks to other types of files

The destination file in your hyperlink does not have to be another HTML file. Some web sites are written using PHP or ASP files and you can link to images, PDF files, Word, Excel or PowerPoint documents or just about any other type of file you like. However, what happens when the link is clicked on will depend on how the person viewing your site has their browser and PC set up.

For example; if your hyperlink is an image it might open in the existing browser window, in their chosen application for viewing that type of image file, or it could open a dialogue box giving them the choice to open, save or cancel the file.

If your link is not to another HTML file it is a good ides to let people know so they can decide whether or not to click on the link, like this:

Read our <a href="report.pdf">Report</a> (PDF file, 6.32KB)

Read our Report (PDF file, 6.32KB)

View <a href="lioncub.jpg">JPEG image of a Lion Cub</a>

View JPEG image of a Lion Cub

You could add a small icon to represent the type of file and use this same icon with each hyperlink to that type of file, like this:

Read our Report PDF file PDF file, 6.32KB

View image of a Lion Cub JPEG Image JPEG Image

If the person does not have the appropriate application to open the file they will not be able to read the content, so choose your file format carefully. In general, most people will be able to open GIF, JPEG, BMP and PNG image files.

  • You can download viewers for some types of file without needing the full version of the software. It is a good idea to include a link to a viewer if you have file download links.