web端a标签文件下载服务端实现下载功能(解决浏览器兼容问题)
后台使用TP
public function downloadFile()
{
$filePath = '文件路径';
$readBuffer = 1024;
$allowExt = ['jpeg', 'jpg', 'peg', 'gif', 'zip', 'rar', 'txt'];
//检测下载文件是否存在,权限
if (!is_file($filePath) && !is_readable($filePath)) {
retu
原创
2021-03-11 16:56:52 ·
630 阅读 ·
0 评论