根据我上面的评论,您只能强制拥有一个下载选项。为此,您可以通过这种方式设置标题 -
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
header("Content-Disposition: attachment;filename=\"filename.xlsx\"");
header("Cache-Control: max-age=0");
参考 - PHP Excel 阅读器
如需更多选项,您还可以查看备忘单 - 备忘单
虽然在这里阅读的最佳方式 - Codeplex
编辑
做这样的事情 -
$excel = new PHPExcel();
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="your_name.xls"');
header('Cache-Control: max-age=0');
// Do your stuff here
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
// This line will force the file to download
$writer->save('php://output');