Home >类库下载 >PHP类库 >php download file, add response header

php download file, add response header

高洛峰
高洛峰Original
2016-10-10 10:47:351512browse

//Download, add response header information
header('Content-type:application/octet-stream');
header('Content-Disposition:attachment;filename="'.basename($file).'"') ;
header('Content-Length:'.filesize($file));
readfile($file);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more