如下所示:
1
2
3
4
5
|
//下載,添加響應頭信息 header( 'Content-type:application/octet-stream' ); header( 'Content-Disposition:attachment;filename="' . basename ( $file ). '"' ); header( 'Content-Length:' . filesize ( $file )); readfile( $file ); |
以上就是小編為大家帶來的php下載文件,添加響應頭的簡單實例的全部內容了,希望對大家有所幫助,多多支持服務器之家~