PHP用header开展文件下载

WBOY
Release: 2016-06-13 12:41:49
Original
853 people have browsed it

PHP用header进行文件下载
各位,我用header导出csv,我在本地测试可以成功下载导出,但是在服务器就只能直接显示在网页上了,不能下载,为什么会这样?
我的header是这样的:

header("Content-Description: File Transfer"); <br />
header("Content-Type: application/octet-stream");<br />
header("Content-Type: application/vnd.ms-excel");<br />
header("Content-Type: application/force-download"); <br />
header("Pragma: public"); <br />
header("Accept-Ranges: bytes"); <br />
header("Expires: 0");<br />
header('Content-Disposition: attachment;filename="data.csv"');<br />
header("Content-Transfer-Encoding: binary");<br />
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");<br />
header('Cache-Control: private',false);
Copy after login

PHP csv 下载
Related labels:
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