21,887
社区成员
发帖
与我相关
我的任务
分享
$filePath = getfilepath(); //absolute
header('Content-type: application/octet-stream;');
header('Content-Disposition: attachment; filename="' . utf8_decode($fileName) . '"');
$size = getfilesize();//return string
header('Content-length: ' . $size);
if ($fd = fopen($filePath, 'rb')) {
session_write_close();
while (!feof($fd)) {
print (fread($fd, 65535));
}
fclose($fd);
}