当前位置:首页 > 前端 > 正文

php下载文件添加header响应头

header( ‘Content-type:application/octet-stream‘ ); header( ‘Content-Disposition:attachment;filename="‘ . basename ( $file ). ‘"‘ ); header( ‘Content-Length:‘ . filesize ( $file )); readfile( $file );