我的代码:
$zip_name="download.zip";
$ctype="application/zip";
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Type: $ctype");
// change, added quotes to allow spaces in filenames
header("Content-Disposition: attachment; filename=\"".basename($zip_name)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($zip_name));
readfile("$zip_name");
现在文件下载到下载文件夹。
我需要下载 D: 驱动器中的所有文件。