【发布时间】:2010-09-07 22:07:39
【问题描述】:
我在documentation for PHP readfile看到了这个例子
<?php
$file = 'monkey.gif';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
你怎么能让它下载多个文件说monkey.gif和girraffe.jpg
最好不要 ZIP 文件...
【问题讨论】:
-
一个 HTTP 请求,一个文件...
-
在哪里见过这样的下载?