This question gets asked alot but the answer is incredibly simple. You treat the document as if it’s another webpage that is you ‘link’ to it and the browser will do the rest. Any file that is not recognised as a webpage by any browser is treated as a ‘download’ and will ask the user if this file should be ‘opened’ or ‘saved’. An example of this can be seen below.
This screenshot shows the option of opening the file straight away with the relavent program, in this case MS Office, or downloading directly on to the hard drive. This is done by simply coding this to your website:
<a href="http://myWebsite.com/myDocument.doc">Download this document here</a>
The same method can be used to download Adobe Acrobat Reader PDF (.pdf) files although with .pdf files most browsers will have a special plug-in that automatically opens the document without having to specify which program to use.
<a href="http://myWebsite.com/myDocument.pdf">Download this PDF document here</a>

Leave a Reply
You must be logged in to post a comment.