ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
<ul> <li><a href="download.php?id=1">文件1</a></li> <li><a href="download.php?id=2">文件2</a></li> <li><a href="download.php?id=3">文件3</a></li> </ul> ``` <ul> <li><a href="download.php?id=1">文件1</a></li> <li><a href="download.php?id=2">文件2</a></li> <li><a href="download.php?id=3">文件3</a></li> </ul> ``` php: ``` //通过这个id去获取数据库下载表中的下载路径,然后把下载路径放入下面代码中打开... $id = GET['id']; //打开文件 $file = fopen('test.rar','r'); //定义下载头部信息 header("content-type:application/octet-stream"); header("accept-ranges:bytes"); //清理filesize()函数的缓存 clearstatcache(); header("accept-length:".filesize('test.rar')); header("content-disposition:attachement;filename='test.rar'"); echo fread($file,filesize('test.rar')); fclose($file); exit; ```