首页 >php教程 >PHP源码 >php 打开浏览器下载对话框

php 打开浏览器下载对话框

PHP中文网
PHP中文网原创
2016-05-26 08:18:131106浏览

跳至

$library_path = dirname(dirname(dirname(dirname(__FILE__))))."/library/file/";
		$file = $library_path."ip_library_ok.txt";
		header('Content-Description: File Transfer');
		header('Content-Type: application/octet-stream');
		header('Content-Disposition: attachment; filename='.basename($file));
		header('Content-Transfer-Encoding: binary');
		header('Expires: 0');
		header('Cache-Control: must-revalidate');
		header('Pragma: public');
		header('Content-Length: ' . filesize($file));
		ob_clean();
		flush();
		readfile($file);

                   

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn