闲者博客 - 强制
https://bk1314.com/tag/%E5%BC%BA%E5%88%B6/
-
关闭浏览器输入http强制跳转到https[适合谷歌内核的 一般都是比如360浏览器]
https://bk1314.com/64.html
2022-04-14T18:01:43+08:00
关闭谷歌浏览器默认跳转https浏览器地址输入:chrome://flags/然后搜索:Omnibox Updated connection security indicators然后 这个选择disabled 重启浏览器就好了
-
PHP强制性文件下载
https://bk1314.com/41.html
2022-02-25T18:54:59+08:00
<?php
/**
*@param $file - path to file
*/
function force_download($file) {
if ((isset($file)) && (file_exists($file))) {
header("Content-length: " . filesize($file));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $file . '"');
readfile("$file");
} else {
echo "No file selected";
}
}
?>