下载.xls文件不会在php中的文件中提供数据

时间:2014-01-20 10:38:44

标签: javascript php jquery html

我想将数据放入.xls文件......但它没有给....

$this->load->view("partial/footer_excel");
$content = ob_end_flush();

$filename = trim($filename);
$filename = str_replace(array(' ', '/', '\\'), '', $title);
$filename .= "_Export.xls";
ob_clean();
ob_start();
header('Content-type: application/vnd.ms-excel; charset=utf-8');
//header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
echo $content;
die();

0 个答案:

没有答案