php实现文件下载, 1 public function get_download_file() 2 { 3 header ( 'content-description: file transfer' ); 4 header ( 'content-type: application/octet-stream' ); 5 header ( 'content-disposition: attachment; filename=' . basename ( $file )); 6 header ( 'content-transfer-encoding: binary' ); 7 header ( 'expires: 0' ); 8 header ( 'cache-control: must-revalidate' ); 9 header ( 'pragma: public' );10 header ( 'content-length: ' . filesize ( $file ));11 ob_clean ();12 flush ();13 readfile ( $file );14 exit;15 }
http://www.bkjia.com/phpjc/1136182.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1136182.htmltecharticlephp实现文件下载, 1 public function get_download_file() 2 { 3 header ( 'content-description: file transfer' ); 4 header ( 'content-type: application/octet-stream' ); 5 heade...