if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
header('Content-Type: "' . $mime . '"');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Content-Transfer-Encoding: binary");
header('Pragma: public');
header("Content-Length: " . strlen($data));
}
else {
header('Content-Type: "' . $mime . '"');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
header("Content-Length: " . strlen($data));
}
PHP实现下载功能
最新推荐文章于 2021-03-24 22:20:28 发布