将导出CSV保存到所需位置-PHP

将导出CSV保存到所需位置-PHP,php,Php,我有这样的代码 header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=\"$filename\""); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); header("Pragma: public"); 现在,它保存在我

我有这样的代码

header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
现在,它保存在我的桌面上。如果我希望将xls文件保存为D:/xls/ 那么如何添加代码。 请帮帮我

谢谢- 哈恩

如果我想将xls文件保存在D:/xls/中,那么如何添加代码

服务器无法向客户端指定保存文件的位置

这是一个只有客户才能做出的决定

想象一下,如果服务器可以告诉客户端在哪里保存文件。您可以覆盖用户系统上的任何文件。这将是设计拙劣的互联网安全漏洞历史上最大的安全漏洞

如果我想将xls文件保存在D:/xls/中,那么如何添加代码

服务器无法向客户端指定保存文件的位置

这是一个只有客户才能做出的决定

想象一下,如果服务器可以告诉客户端在哪里保存文件。您可以覆盖用户系统上的任何文件。这将是设计拙劣的互联网安全漏洞历史上最大的安全漏洞