• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Website Coding: Forcing links to download instead of opening in browser

talyn00

Golden Member
How can you code a website so that if you have a link to a word doc or pdf file it downloads instead of attempting to view the file in your browser? Is there a way to force a download dialogue box to show up?

Thanks.
 
Configure your webserver so that the mime-type for the files you want to download is set as something that browsers wont open.
 
just put it in a zip or rar and have a link somewhere to a download of winrar and/or other freeware solutions for people who dont have xp
 
If you know any server side scripting like PHP, you can easily code a download page that will have the file download instead of opening in a plugin.

Sample code for setting the MIME type using the PHP header function:
 
Back
Top