php header 下载文件

正文开始

~~~ $fileContent = file_get_contents($fullUrl); $finfo = finfo_open(FILEINFO_MIME); $minType = finfo_file($finfo, $fullUrl); finfo_close($finfo); $array = explode(';', $minType); $minType = $array[0]; $fileSize = filesize($fullUrl); $fileName = basename($fullUrl); $this->view->engine->layout(false); header("Content-type:{$minType}"); header("Accept-Ranges:bytes"); header("Accept-Length:".$fileSize); header("Content-Disposition: attachment; filename=".$fileName); echo $fileContent; ~~~

正文结束

PHP接口(interface)和抽象类(abstract) thinkphp5权限菜单自动转多语言的坑 是authRule.model的魔术方法引起的