By default, the files will open up to your current page or open up a tab when clicked via target="_blank" attribute. Well, that is for me not a good experience, most especially if your website is a downloading site.
You can also try to make a script to force the files to download either via php, asp, or any language, but that will be tedious.
Why do you need to be hard on yourself if you can do it fast and easy.
Please see below syntax that you can put in on your htaccess to force the file to download on your website.
AddType application/force-download .csv
AddType application/force-download .xls
AddType application/force-download .doc
AddType application/force-download .docx
AddType application/force-download .avi
AddType application/force-download .mpg
AddType application/force-download .mov
AddType application/force-download .wav
AddType application/force-download .zip
AddType application/force-download .mp3
AddType application/force-download .pdf
Hope this helps. Thank you for reading such a short post.
No comments:
Post a Comment