Results 1 to 4 of 4

Thread: IE7 pdf download impossible!

  1. #1
    Join Date
    Feb 2007
    Location
    C.T
    Beans
    107

    Question IE7 pdf download impossible!

    Hello everyone,

    I'm trying to create a "run of the mill" PHP script that will allow users to download a PDF from some website. The script works great in Firefox but not in IE7. Please have a look at the script and tell me what I'm doing wrong...
    it's attached below. I've tried a few of the scripts provided at php.net but those result in either IE7 or Firefox working and the other not...

    Thanks,
    Thyme

    EDIT:

    The script is:

    ################################################## ########

    <?php
    session_start();

    $document = $_GET['show'];
    $client = <some client ID>;

    // We'll be outputting a PDF
    header('Content-type: application/pdf');

    // It will be called downloaded.pdf
    header('Content-Disposition: attachment; filename="'.$document.'" ');

    header('Content-Description: pdf');

    // The PDF source is in original.pdf
    readfile('../../../download/'.$client.'/'.$document.'');

    ?>

    ################################################## ########

    It seems as thought IE is not picking up the readfile() path as well as Firefox does...
    Last edited by Thyme; May 3rd, 2007 at 10:55 AM. Reason: Forgot attachment

  2. #2
    Join Date
    Nov 2005
    Beans
    593
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: IE7 pdf download impossible!

    Code:
    $document = $_GET['show'];
    readfile('../../../download/'.$client.'/'.$document.'');
    Anyone could download any file in the server by choosing the right path in $_GET['show']. This is a big security hole.

  3. #3
    Join Date
    Feb 2007
    Location
    C.T
    Beans
    107

    Re: IE7 pdf download impossible!

    Thanks for the feedback, Mirrorball. I will definitely keep that in mind and try to change that once my PHP skills have improved.

    However, do you perhaps know how I can download PDF's with a script that works with both IE7 and Firefox? Any help will be greatly appreciated...

  4. #4
    Join Date
    Nov 2005
    Beans
    593
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: IE7 pdf download impossible!

    I don't know. But here several possibilities are suggested:
    http://www.php.net/header
    http://www.php.net/readfile

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
  •