if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $filename. "." . $exts );
flush();
readfile($file);
exit;
}
此代码适用于PC,但在移动设备上我无法打开该文件。标题不正确?
答案 0 :(得分:0)
尝试添加:
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
在
header('Content-Disposition: attachment; filename=' . $filename. "." . $exts );