|
If you have PDF files on your server that you wish to provide to your users in the form of a downloadable link, you've probably found that simply including a link to the file doesn't quite work as you'd expect...
Most modern web browsers render PDF files within the page you are viewing when clicked and the expected "Save As" popup box does not appear.
Adding the following code to your .htaccess.php file, found in your Joomla! installation root folder, will force any link to a PDF in your Joomla! articles, modules, components, etc to prompt the user to save. This is particularly useful if you don't want to install a Joomla! downloads component.
1
2
3
4
|
<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
|
|