The first paragraph is read file, download.
The second paragraph is a string download.
Copy the Code code as follows:
$fileName = "Prefs.csv";
Header (' Content-type:application/octet-stream ');
Header (' content-disposition:attachment; Filename= '. $fileName);
Header (' content-transfer-encoding:binary ');
Header (' Content-length: '. FileSize ($fileName));
ReadFile ($fileName);
Copy the Code code as follows:
$fileName = "Pref_". Date ("Ymdhis"). ". csv";
Header (' Content-type:application/octet-stream ');
Header (' content-disposition:attachment; Filename= '. $fileName);
Echo $csv;
http://www.bkjia.com/PHPjc/621682.html www.bkjia.com true http://www.bkjia.com/PHPjc/621682.html techarticle The first paragraph is read file, download. The second paragraph is a string download. Copy the code as follows: PHP $fileName = "Prefs.csv"; Header (' Content-type:application/octet-stream '); Header (' ...