When you place something on your web site you either want it to display in the web browser or you want it to be offered for download. There is no command in HTML though that allows you to specify which of these two options that you want though. How then can we control which files open in the web browser and which are offered for download?
The reason why HTML doesn't have a tag to distinguish these alternatves is that the choice needs to be made before the file starts to load into the browser and the specification of whether the file should be displayed or offered for download is considered to belong to the file and not to the page linking to it.
There are actually two factors that determine whether a file will be offered for download or displayed in the browser. The first of these is the content-disposition header. This header is generally set for known file types (either by mime type or file extension) for the web server and can also be set upsing any server side language that is being used to deliver the files. This header has two values attachment indicating that the file should be offered for download and inline indicating that if possible the file should be displayed by the browser.
This second option doesn't guarantee that the file will not be offered for download since each browser is only capable of displaying certain file types (eother natively or through the use of plugins) and if the browser is not configured to be able to display a particular file type then files of that type will always be offered for download since the option of displaying them in the browser doesn't exist. For example Internet Explorer (at least IE8 and earlier) is unable to display XHTML files (mime type application/xml-xhtml) and so will always offer XHTML files for download whereas other browsers can display that file type in the browser and will therefore do so unless the content-disposition is set to attachment.
This inability of browsers to display all file types in the browser itself also leads to the second way to make sure that a file is always offered for download and that is to select a file type that you know that no browser supports. Now this option is not practical for the original file formats that the files you want to offer for download may be in since those may be types that some or all browsers can display. The option that will always work for offering the file for download is to create a compressed archive containing the file or files to be downloaded. This not only allows you to ensure that the file will be offered for download but it also ensures that the file to be downloaded is as small as possible and allows multiple related files to be downloaded in one go. Such archives usually use a .zip file extension on Windows or a .tar.gz extension on Linux. There are plenty of free programs available that you can use to create these archives and which your visitors can also use to extract the files again after they download them.
Between these two alternatives you have as complete control of what files display in the browser and what are offered for download as is possible (remembering of course that if your visitor's browser can't display a file it will always offer t for download instead). There is therefore no need for anything within HTML itself to distinguish which <a> tags link to files to be displayed in the browser and which link to files that will be offered for download.
This article written by Stephen Chapman, Felgall Pty Ltd.