$file='url.xlsx';
if (file_exists(EA_DIR_DATA . $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(EA_DIR_DATA .$file));
ob_clean();
flush();
readfile(EA_DIR_DATA . $file);
}
$file为要下载的文件,一般多文件都是压缩下载