php下载文件,添加响应头的简单实例

2016-11-09 15:43:27  php下载文件

如下所示:

//下载,添加响应头信息 header('Content-type:application/octet-stream'); header('Content-Disposition:attachment;filename="'.basename($file).'"'); header('Content-Length:'.filesize($file)); readfile($file);

以上就是小编为大家带来的php下载文件,添加响应头的简单实例的全部内容了,希望对大家有所帮助,多多支持~

php下载文件,添加响应头的简单实例》阅读地址:http://www.haoshilao.net/11918/

最新图文教程: