function sendfile($myfile){
$mm_type="application/octet-stream";
$fp = fopen($myFile,'rb');
$size = filesize($myFile);
ob_start();
立即学习“PHP免费学习笔记(深入)”;
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $mm_type);
header('Content-Disposition: attachment; filename="'.$fname.'"');
header("Content-Transfer-Encoding: binary ");
if (isset($_SERVER['HTTP_RANGE']) && ($_SERVER['HTTP_RANGE'] != "") && preg_match("/^bytes=([0-9]+)-/i", $_SERVER['HTTP_RANGE'], $match) && ($match[1]
$range = $match[1];
fseek($fp, $range);
如果您是新用户,请直接将本程序的所有文件上传在任一文件夹下,Rewrite 目录下放置了伪静态规则和筛选器,可将规则添加进IIS,即可正常使用,不用进行任何设置;(可修改图片等)默认的管理员用户名、密码和验证码都是:yeesen系统默认关闭,请上传后登陆后台点击“核心管理”里操作如下:进入“配置管理”中的&ld
0
header("HTTP/1.1 206 Partial Content");
//header("Date: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s", filemtime($myFile))." GMT");
header("Accept-Ranges: bytes");
$rangesize = ($size - $range) > 0 ? ($size - $range) : 0;
header("Content-Length:".$rangesize);
header("Content-Range: bytes ".$range.'-'.($size-1)."/".$size);
//header("Connection: close"." ");
}else{
header("Content-Length: ".(string)($size));
header("Accept-Ranges: bytes");
$range = 0;
}
fpassthru($fp);
ob_end_flush();
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号