public function getDown()
{
$file = fopen ( 'aa.php', "r" );
//输入文件标签
Header ( "Content-type: application/octet-stream" );
Header ( "Accept-Ranges: bytes" );
Header ( "Accept-Length: " . filesize ( 'aa.php' ) );
Header ( "Content-Disposition: attachment; filename=aa.php" );
//输出文件内容
//读取文件内容并直接输出到浏览器
echo fread ( $file, filesize ( 'aa.php' ) );
fclose ( $file );
exit ();
}
php 声明下载文件代码示例
PHP文件下载功能实现
最新推荐文章于 2025-10-25 17:05:42 发布
690

被折叠的 条评论
为什么被折叠?



