Force Download Dialog Boxes
Posted by Patrick Lin on Thu 4 February, 2010 at 05:00:12 · Tags: htaccess, php
When we browse the web, we click on links. That’s what makes the web a web – the links between pages. Sometimes, those links lead us not to pages, but to files. Many types of files pop up dialog boxes prompting downloads – executables, videos, etc.
However, certain filetypes, thanks to modern web browsers, are rendered as an in-browser page, such as images, PDFs, and MP3s. While this may be a convenience, at times we may wish to force the user to download the files, not just view them in their browser.
In this article I will show two easy ways to do this. The first is using .htaccess, and the second is using PHP.





0