phpexcel

WBOY
Release: 2016-06-06 20:14:19
Original
1113 people have browsed it

phpexcel如何把导出的文件 命名 他现在已导出就是一个export 我想定义自己的名字

回复内容:

phpexcel如何把导出的文件 命名 他现在已导出就是一个export 我想定义自己的名字

1.保存到webserver

<code>$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
$objWriter->save ( '文件名.xls' );
</code>
Copy after login

2.浏览器下载

<code>$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
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/vnd.ms-execl");
header("Content-Type:application/octet-stream");
header("Content-Type:application/download");
header("Content-Disposition:attachment;filename="文件名.xls");
header("Content-Transfer-Encoding:binary");
$objWriter->save("php://output");</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template