엑셀파일 기준.

안까먹기 위해서.



$sFilePath = '/tmp/myfile.xls';
$sFileName = 'myfile.xls';

header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=".$sFileName);
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strval(filesize($sFilePath)));
header("Cache-Control: cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");

echo file_get_contents($sFilePath);
flush();




Posted by bloodguy
,