Home  >  Article  >  Backend Development  >  PHP forced download file code_PHP tutorial

PHP forced download file code_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:33:54745browse

Copy code The code is as follows:

$filename = '1.png';
header( "Content-Type: application/force-download");
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $filename;
?> ;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322500.htmlTechArticleCopy the code as follows: ?php $filename = '1.png'; header("Content-Type: application /force-download"); header('Content-Disposition: attachment; filename="'.$filename.'"'); echo $...
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