How do I force a hyperlink to download a file instead of opening the file?

If you have a txt or html file or any other type of file that you are offering for download but the browser opens the page no matter what you try, you can use some ASP to get the desired results.

Answer/Solution:

Add this code to a blank page and be sure to customize first:

Response.ContentType =3D "text/plain"

Response.AddHeader "Content-Disposition", "attachment;filename=3DYOURFILENAME.TXT"

Note: insert the proper filename for 'yourfilename.txt', but leave the '3D' at the beginning.

Save this page when you are done, you can test it by clicking on the link.