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

php download file, add response header

高洛峰
Release: 2016-10-10 10:47:35
Original
1510 people have browsed it

//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);

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template