IE downloads file twice if it's loaded from PHP

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

kbazsi

Thread Starter
Joined
Mar 3, 2006
Messages
31
Hi,

I'm using the Spreadsheet_Excel_Writer PEAR package to create excel files from PHP. My problem is that when I choose Open in IE the file is downloaded twice, and it ask me twice to open or save. I checked the code and they send these headers:
PHP:
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
In the past I used these headers to load a file from a database and it worked fine:
PHP:
if (isset($_SERVER["HTTPS"])) {
        header("Pragma: ");
    }
header("Content-length: ".$row['size']);
header("Content-type: ".$row['type']);
header("Content-Description: ".$row['name']);
header("Content-Disposition: attachment; filename=".$row['name']);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Connection: close");
I tried to combine them but nothing works.
Any suggestion?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top