Force save files all browsers - not open in browser window
- by Joshc
I'm after a simple solution to work in all browsers.
For specific file types, or targeted links via a class: how can I get them to simply force download in all major browsers.
I thought I found the perfect solution for apachce server - by adding this into the .htaccess.
http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/
AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf
Seems to work in Firefox and Safari, but not chrome or IE (have not tested anything else)
Can any one please help me with a solution on how to make links to force download the file, instead of opening in the browser, for ALL browsers.
I can't seem to find a full browser proof solution. Is it not possible?
Any links to tutorial or snippets would be awesome.
My website if PHP based so can make it work with PHP if posible.
Thanks