$fileDir = ROOT_PATH .
"download/"
;
$fileName =
"download.zip"
;
$file = fopen($fileDir . $fileName,
"r"
);
// 输入文件标签
Header(
"Content-type: application/octet-stream"
);
Header(
"Accept-Ranges: bytes"
);
Header(
"Accept-Length: "
.filesize($fileDir . $fileName));
Header(
"Content-Disposition: attachment; filename="
. $fileName
// 输出文件内容
echo
fread( $file,filesize($fileDir . $fileName));
fclose(
$file
);