Hey all - i have a script that generates an excel file and pumps it over to the user via html headers. It works fine in all browsers using http, but if using https, things go awry. In Internet Explorer, instead of giving me the opportunity to download the excel file, it asks me if i want to download the php script! (then generates an error if i say yes.) The code is below. Suggestions would be most appreciated! (Ps, i've tried it with content-type = text - no go).
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=report.xls");
header("Pragma: no-cache");
header("Expires: 0");
for ($i=1; $i<=$numToShow; $i++) {
$header .= $aryLookupTable[$i]['columnTitle'];
if ($i !=$numToShow) {
$header .= $delimiter;
}
}
foreach ($arySortedResult as $row) {
$line = '';
for ($i=1; $i<=$numToShow; $i++) {
if ($row[$i] != "") {
$line .= $row[$i];
if ($i !=$numToShow) {
$line .= $delimiter;
}
} else {
if ($i !=$numToShow) {
$line .= " ".$delimiter;
}
}
}
$data .= $line."\n";
}
echo $header."\n".$data;