php隐藏实际地址的文件下载方法
下面这段php代码可不透露实际的文件下载地址, pre-check=0); header(Content-Disposition: attachment; filename = $filename); header(Content-Length: . filesize($pathto . $filename)); header(Content-Type: $mimetype); echo file_get_contents($pathto . $filename); } 实现方法二: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ?php $file = 1.txt;// 文件的真实地址(支持url,$path=,不过不建议用url) if (file_exists($file)) { header(Content-Description: File Transfer); header(Content-Type: application/octet-stream); header(Content-Disposition: attachment; filename=.basename($file)); header(Content-Transfer-Encoding: binary); header(Expires: 0); header(Cache-Control: must-revalidate, pre-check=0); header(Pragma: public); header(Content-Length: . filesize($file)); ob_clean(); flush(); readfile($file); exit; } ? , post-check=0, ? 1 2 3 4 5 6 7 8 function download_document($filename,$mimetype=application/octet-stream) { header(Cache-Control: must-revalidate, post-check=0,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://www.juheyunku.com/jiaob/php/12356.shtml
相关文章
热门TAG
服务器 命令 技巧 详解 调用 标签 功能 织梦 javascript dedecms修改内容 织梦教程 php 白帽 企业网站 外链 权重 MYSQL 网站流量 实例解析 JSP 网站收录 搜索引擎 蜘蛛 windows jquery jquery教程 python tags标签 HTML 织梦cms最新文章
-
护卫神php套件 php版本升级
时间:2021-01-10
-
浅析iis7.5安装配置php环境
时间:2021-01-10
-
PHP异常处理浅析
时间:2021-01-06
-
PHP嵌套输出缓冲代码实例
时间:2021-01-06
-
PHP的伪随机数与真随机数
时间:2021-01-04
-
php实现的日历程序
时间:2020-12-29
-
PHP实现链式操作的核心思
时间:2020-12-29
-
PHP中把错误日志保存在系
时间:2020-12-29
热门文章
-
2019年最好用的10个php开发工具推荐
时间:2020-12-23
-
PHP的伪随机数与真随机数详解
时间:2021-01-04
-
PHP中把错误日志保存在系统日志中(Win
时间:2020-12-29
-
浅析iis7.5安装配置php环境
时间:2021-01-10
-
Destoon启用https 后台登录不了
时间:2020-12-23
-
php实现的日历程序
时间:2020-12-29
-
PHP实现链式操作的核心思想
时间:2020-12-29
-
php工作前景怎么样
时间:2020-12-19
-
10个免费的PHP编辑器/开发工具推荐
时间:2020-12-23
-
什么是PHP?其优势有哪些?
时间:2020-12-23
