php 文件下载
来源:互联网 发布:ab plc编程软件中文版 编辑:程序博客网 时间:2024/06/05 20:22
<?php
//文件下载
$file = './../1.xls';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
//header('Content-Disposition: attachment; filename="'.$filename.'"');
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;
}
?>
//文件下载
$file = './../1.xls';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
//header('Content-Disposition: attachment; filename="'.$filename.'"');
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;
}
?>
0 0
- PHP实现文件下载
- PHP实现文件下载
- PHP实现文件下载
- php 文件下载类
- php自动下载文件
- php下载文件代码
- PHP实现文件下载
- 关于PHP文件下载
- PHP强制性文件下载
- php 下载文件代码
- PHP下载文件
- php下载文件
- php强制下载文件
- php下载文件
- php下载文件
- php下载文件方法
- php下载文件
- PHP下载文件代码
- mac 下运行.sh文件出现 Permission denied问题
- Ubuntu SVN命令大全
- JAVA的StringBuffer类--------StringBuffer与String的区别及用法
- 正则表达式参考 TCL语言版收藏
- Java设计模式——装饰者模式
- php 文件下载
- SQL SERVER DBA 只给某用户开通 对存储过程的readonly权限
- hibernate4 比 hibernate3 优点
- 第十一周项目4——类族的设计
- 简单的几个shell脚本四
- C语言 判断给定数组是否为二叉查找树后序遍历结果
- curl伪造reffer抓取图片资源的方法
- jQuery 效果 - animate() 方法
- activiti工作流