Guest Lumberjack Posted August 19, 2006 Share Posted August 19, 2006 I've just finished writing a website for my parents villa. I've only one problem and that is the link I will need so that visitors can download the PDF of the 'Booking Terms & Conditions'. When the link is currently clicked it just opens the file in an IE Explorer window without giving the option to save it.Any ideas?The code is as follows:----------------------------------------------------------------------------------------------------------------------------- <p align="center"> <font size="4" color="#800000"> <a target="_blank" href="downloads/booking%20terms%20&%20conditions.pdf"> <font color="#800000">Booking Terms & Conditions</font></a></font></p>----------------------------------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Moridin Posted August 19, 2006 Share Posted August 19, 2006 How about just telling them to click "Save As" or simple compress the file?- Moridin Link to comment Share on other sites More sharing options...
smiles Posted August 22, 2006 Share Posted August 22, 2006 When the link is currently clicked it just opens the file in an IE Explorer window without giving the option to save it.I remember that PDF is free online document , so choice to save or open is ... free too How about just telling them to click "Save As" or simple compress the file?no, that not work Link to comment Share on other sites More sharing options...
Jack McKalling Posted August 22, 2006 Share Posted August 22, 2006 You can create or get a php script for that, go here:http://nl3.php.net/manual/en/function.header.php <?php// We'll be outputting a PDFheader('Content-type: application/pdf');// It will be called downloaded.pdfheader('Content-Disposition: attachment; filename="downloaded.pdf"');// The PDF source is in original.pdfreadfile('original.pdf');?>This will always get the download dialogbox open. (should) Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2006 Share Posted August 22, 2006 That will not open the download box, if the Acrobat plugin is installed it will still open it in the browser because the mime type is set to PDF. If you set the mime type to application/octet-stream instead, it will always force a download box. Link to comment Share on other sites More sharing options...
Jack McKalling Posted August 23, 2006 Share Posted August 23, 2006 My mistake, just copied some example code from php.net. I don't do this often myself. :)But at least use that code, with the "application/octet-stream" mimetype Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now