21 Temmuz 2009 Salı

Php Content-Disposition: IE hatası.

Bize verilen projede phpde bir tabloyu excel'e aktarım yapmam istenmişti.
bende :

$filename ="excelreport.xls";
header('Content-type: application/force-download');
header('Content-Disposition: inline;attachment; filename=$filename');
echo $contents;
bkz: http://www.daniweb.com/forums/thread124300.html#


kodunu kullandım.
Bu kod IE hariç (Firefox,Operada vs.. çalışıyordu.)


Sonra google da yaptığım ufak araştıma ile
bkz : http://coding.derkeiler.com/Archive/PHP/alt.php/2006-05/msg00569.html



$filename ="excelreport.xls";
header("Cache-Control: no-stor,no-cache,must-revalidate");
header("Cache-Control: post-check=0,pre-check=0", false);
header("Cache-control: private");
header("Content-Type: application/force-download");
header("Content-Disposition: inline; attachment;filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
echo $contents;

ilgili kod bloğu işimi çözdü.

Hiç yorum yok:

Yorum Gönder