Forcing the Download Prompt for files
Sometimes you want to force a file to be downloaded instead of letting the browser decide how to handle it. For alot of servers, text files, for instance, will be displayed on the screen as a bland text page with no formatting. Instead you may want the download prompt to come up, have the user download the file, then have them continue on their way on your website.
To accomplish this simply add an .htaccess file to the directory that the file you want to download is in. For instance, the following script will have any file type with an extension download instead of letting the browser process it.
<Files *.*> ForceType application/octet-stream Header set Content-Disposition attachment </Files>
The *.* section is what matches to files. So if you only want text files to download, use *.txt
Please note that .htaccess files may not work if your server has increased security measures. Check with your hosting service to see if .htaccess files are allowed if you are having issues with this script.