【发布时间】:2013-06-20 11:07:12
【问题描述】:
我知道以前有人问过这个类似的问题,但我找不到针对我的具体问题的解决方案。 我有这段代码,它保存到一个文件中,并在从浏览器运行时立即下载到桌面。但我需要将其保存在服务器上。如何使用此特定代码执行此操作?
我需要将文件保存到变量中吗? $files先?
<?php
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=export_".date('n-j-Y').".xls ");
header("Content-Transfer-Encoding: binary ");
exit();
?>
【问题讨论】:
-
@Dale 我读过,但不明白。你能帮帮我吗?