1publicfunction get_download_file() 2{ 3header ( 'Content-Description: File Transfer' ); 4header ( 'Content-Type: application/octet-stream' ); 5header ( 'Content-Disposition: attachment; filename=' . basename ( $file )); 6header ( 'Content-Transfer-Encoding: binary' ); 7header ( 'Expires: 0' ); 8header ( 'Cache-Control: must-revalidate' ); 9header ( 'Pragma: public' ); 10header ( 'Content-Length: ' . filesize ( $file )); 11ob_clean (); 12flush (); 13readfile ( $file ); 14exit; 15 }
以上就介绍了init.php文件 PHP实现文件下载,包括了init.php文件方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
已抢65579个
抢已抢30287个
抢已抢16662个
抢已抢8445个
抢已抢10925个
抢已抢22309个
抢