Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1

    Unhappy save pdf file not open

    how do i get a pdf file link to open the save dialog prompt box, not just open the pfd file in WD7 Premium

    Stuart

  2. #2

    Default Re: save pdf file not open

    In general, this is a browser setting issue and you don't actually have control over it. I am unaware of an HTML link solution. Perhaps someone else will now of one.

    Do a Google search for a PHP script (if on a linux host) that you can use. They are out there. Basically what the script will do is to fool browsers by using a mime type that the browser doesn't recognize and therefore cannot open. The result is that the browser will offer to save the linked file.

    Take care, Mike

  3. #3
    Join Date
    Aug 2010
    Posts
    533

    Default Re: save pdf file not open

    Add a new blank page you can give it the same name as the PDF file and include the .php extension eg. mypdffile.php

    Then place the following code using a placeholder (changing "mypdffile" to the name of your PDF file)
    PHP Code:
    <?php
    header
    ('Content-disposition: attachment; filename=mypdffile.pdf');
    header('Content-type: application/pdf');
    readfile('mypdffile.pdf');
    ?>
    The PDF should be uploaded to your home directory or else you will need to change the file path eg. "index_htm_files/mypdffile.pdf"
    Then create a link to the page mypdffile.php
    This will force the file to download rather than opening in your browser.
    Last edited by jamesd; 28 October 2011 at 09:51 PM.

  4. #4

    Default Re: save pdf file not open

    many thanks, I will give it a go.

    Stuart

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •