php下载txt文件
$filename = 'abc.txt';
$str = Auth::guard('admin')->id();
header("Content-type: text/plain");
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=".$filename);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header("Pragma: no-cache" );
header("Expires: 0" );
exit($str);

浙公网安备 33010602011771号