若不能播放,按停止,再按播放
您浏览器可能不支持语音朗读,建议使用Chrome浏览器或Edge浏览器
116621

若无法播放请换Edge浏览器或Chrome浏览器
当前:第1页 / 共1页   ↓移到底部


<?php

if (isset($_GET['id']) && !empty($_GET['id'])) {



$id = $_GET['id'];

$aid = intval($id / 1000);

$path = dirname(__FILE__)."/txt/".$aid."/".$id.".txt";

#echo $path;

#header("Location: //dl.fltxt.com/txt/".$aid."/".$id.".txt");

down_file($path,$id);

#exit;

} else {

// 返回空白页面

echo "";

}

function down_file($path, $filename){

header("Content-type: application/x-octet-stream");

header("Accept-Ranges: bytes");

header("Content-Disposition: attachment; filename=".$filename.".txt");

$file_size = filesize($path);

header("Content-Length: ".$file_size);

//nginx 利用 X-Accel-Redirect 直接定位成静态下载

if(!empty($_SERVER['SERVER_SOFTWARE']) && preg_match('/nginx/is', $_SERVER['SERVER_SOFTWARE'])){

header("X-Accel-Redirect: ".str_replace(dirname(__FILE__), '', $path));

return true;

}

$fp = fopen($path,"rb");

$buffer_size = 1024;

$cur_pos = 0;

while(!feof($fp) && $file_size - $cur_pos > $buffer_size){

echo fread($fp,$buffer_size);

ob_flush();

flush();

$cur_pos += $buffer_size;

}

echo fread($fp,$file_size-$cur_pos);

ob_flush();

flush();

fclose($fp);

return true;



}

?>

当前页码:第1页 / 共1页
可使用下面一键跳转,例如第10页,就输入数字:10