![](/img/trans.png)
[英]PHP: How to save mysql to excel file to a directory and not prompt user to download
[英]how to download a file into a specified directory in php?
如何将csv文件下载到指定目录? 现在我使用了这段代码,
header("Location:uploads/".$dire);
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=".$nn);
header("Pragma: no-cache");
header("Expires: 0");
在这里, $dire
是上载文件夹的子目录, $nn
是csv文件名。 我要下载此$nn
文件并保存在指定目录$dire
。 但是它显示了一个错误
提前致谢。
您无法控制客户端(网络浏览器)的行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.