Possible Duplicate:
How to force a pdf download automatically?
I've checked other forums, but I do not understand what they say. I've checked this link which people do seem to get the solution:
http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/
I want to do a button which is done for downloading a PDF, the file is too big to see it online. So I want that button to force the browser to download the file. Asking or not asking the user. There will be different PDF name files so I need to make this button downloadable with PDF formats of various PDF files.
I've checked different webs and it seems it can be done using htaccess, but I honestly have no clue of how to do this. Can somebody help to show me how I can do this!?!?! Is there a simple way via CSS/html??
I've been stuck for a long while for such a small detail.
My code is simply:
<div class="Container for icons">
<a href="hugefile.pdf" alt=""><img href="icon.png" alt=""/>
</div>
Could somebody give me hand on this one?
Instead of
AddType
you could tryForceType
:You'll need to modify the HTTP header returned to the client in order to accomplish this:
Here's a PHP code example: