源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

php 强制下载文件实现代码

  • 时间:2021-09-29 19:29 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:php 强制下载文件实现代码
[u]复制代码[/u] 代码如下:
<?php $file = 'monkey.gif'; 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, post-check=0, pre-check=0');     header('Pragma: public');     header('Content-Length: ' . filesize($file));     ob_clean();     flush();     readfile($file);     exit; } ?> ? <?php header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=ins.jpg");  readfile("imgs/test_Zoom.jpg"); ?>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部