简体   繁体   English

如何将文件下载到php中的指定目录?

[英]how to download a file into a specified directory in php?

How i can download a csv file into a specified directory.? 如何将csv文件下载到指定目录? Now I used this code, 现在我使用了这段代码,

header("Location:uploads/".$dire);
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=".$nn);
header("Pragma: no-cache");
header("Expires: 0");   

Here, $dire is the sub directory of upload folder and $nn is the csv file name. 在这里, $dire是上载文件夹的子目录, $nn是csv文件名。 I want to download this $nn file and saved in a specified directory $dire . 我要下载此$nn文件并保存在指定目录$dire But the it shows an error 但是它显示了一个错误

Thanks in advance. 提前致谢。

您无法控制客户端(网络浏览器)的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM