4,251
社区成员
发帖
与我相关
我的任务
分享
function send_to_browser($filename = "workbook.xls", $format = 'Excel5'){
// load the appropriate IO Factory writer
$objWriter = PHPExcel_IOFactory::createWriter($this->workbook, $format);
// output the appropriate headers
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream');
header('Content-Type: application/download');
header("Content-Disposition: attachment;filename=$filename");
header('Content-Transfer-Encoding: binary');
// output the file
$objWriter->save('php://output');
return; // end processing
}