php强制输出到浏览器下载

$file_name="test.mp3";
$mp3_url = "";
header( "Pragma: public" );
header('Expires: 0');
header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header( "Cache-Control: private", false );
header( "Content-Type: application/force-download ");
//header( "Content-Length: " . $fileSize);
header('Content-Disposition: attachment; filename="'.$file_name.'"');
header('Content-Transfer-Encoding: binary');
header('Connection: close');
readfile($mp3_url);
exit();
posted @ 2018-09-12 10:37  不呐呐  阅读(352)  评论(0编辑  收藏  举报