//下载文件需要用到的头
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length:".$file_size);
Header("Content-Disposition: attachment; filename=".$file_name);
//直接输出即可
echo($data);
//下载文件需要用到的头
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length:".$file_size);
Header("Content-Disposition: attachment; filename=".$file_name);
//直接输出即可
echo($data);
本文标题:PHP实现下载功能
本文链接:https://www.haomeiwen.com/subject/uwqmnftx.html
网友评论