Problem downloading file in IE6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Obi

    Problem downloading file in IE6

    HI all,

    I have a problem during download file with Internet Explorer 6.

    I use this script:

    header('Pragma: public');
    header('Expires : 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Content-Type: application/octet-stream');
    //header('Content-Type: application/force-download');
    header('Content-Disposition: attachment; filename="'.$fi lename.'"');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: ' . filesize($dfile ));

    In same case, this open a dialog box asking if open or save a file
    colled 'index.php' and not the correct file name
    and the description file is 'php file'

    May you help me?

    thanks in advance
    Fabio
  • Jim Carlock

    #2
    Re: Problem downloading file in IE6

    "Obi" posted...
    : I have a problem during download file with Internet Explorer 6.

    Internet Explorer is a BIG problem. over 90% of the world
    uses it.

    : I use this script:
    :
    : header('Pragma: public');
    : header('Expires : 0');
    : header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    : header('Content-Type: application/octet-stream');
    : //header('Content-Type: application/force-download');
    : header('Content-Disposition: attachment; filename="'.$fi lename.'"');
    : header('Content-Transfer-Encoding: binary');
    : header('Content-Length: ' . filesize($dfile ));

    Try taking out the // line? Did you check to see which headers
    actually get sent to the client?

    And are $filename and $dfile the same file?

    : This opens a dialog box asking if open or save a file named
    : 'index.php' (not the proper file).

    echo("filename == " . $filename . "<br />");
    echo("dfile == " . $dfile . "<br />");

    It sounds like the server is delivering the wrong header for
    an index.php file, so perhaps the variable $filename is an
    empty string?

    --
    Jim Carlock
    Post replies to the group.


    Comment

    • Jim Carlock

      #3
      Re: Problem downloading file in IE6

      PARDON if this posts twice. Something funny occurs with the
      Road Runner/TimeWarner/BrightHouse servers.

      "Obi" posted...
      : I have a problem during download file with Internet Explorer 6.

      Internet Explorer is a BIG problem. over 90% of the world
      uses it.

      : I use this script:
      :
      : header('Pragma: public');
      : header('Expires : 0');
      : header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      : header('Content-Type: application/octet-stream');
      : //header('Content-Type: application/force-download');
      : header('Content-Disposition: attachment; filename="'.$fi lename.'"');
      : header('Content-Transfer-Encoding: binary');
      : header('Content-Length: ' . filesize($dfile ));

      Try taking out the // line? Did you check to see which headers
      actually get sent to the client?

      And are $filename and $dfile the same file?

      : This opens a dialog box asking if open or save a file named
      : 'index.php' (not the proper file).

      echo("filename == " . $filename . "<br />");
      echo("dfile == " . $dfile . "<br />");

      It sounds like the server is delivering the wrong header for
      an index.php file, so perhaps the variable $filename is an
      empty string?

      --
      Jim Carlock
      Post replies to the group.


      Comment

      • Obi

        #4
        Re: Problem downloading file in IE6

        Jim Carlock wrote:
        "Obi" posted...
        : I have a problem during download file with Internet Explorer 6.
        >
        Internet Explorer is a BIG problem. over 90% of the world
        uses it.
        >
        : I use this script:
        :
        : header('Pragma: public');
        : header('Expires : 0');
        : header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        : header('Content-Type: application/octet-stream');
        : //header('Content-Type: application/force-download');
        : header('Content-Disposition: attachment; filename="'.$fi lename.'"');
        : header('Content-Transfer-Encoding: binary');
        : header('Content-Length: ' . filesize($dfile ));
        >
        Try taking out the // line? Did you check to see which headers
        actually get sent to the client?
        >
        And are $filename and $dfile the same file?
        >
        : This opens a dialog box asking if open or save a file named
        : 'index.php' (not the proper file).
        >
        echo("filename == " . $filename . "<br />");
        echo("dfile == " . $dfile . "<br />");
        >
        It sounds like the server is delivering the wrong header for
        an index.php file, so perhaps the variable $filename is an
        empty string?
        >
        $filename is onle the name of file
        $dfile is the relative path of file on the server

        The big problem is, on my computer the script works fine.
        On my customer computers, doesn' t works.

        any ideas?

        Comment

        Working...