Home > php教程 > php手册 > PHP 强制下载文件代码

PHP 强制下载文件代码

WBOY
Release: 2016-06-06 20:35:14
Original
1323 people have browsed it

PHP 强制下载文件代码,任意文件下载代码,可以让任何文件都是提示下载的实现代码。

复制代码 代码如下:


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

,免备案空间,网站空间,香港虚拟主机
Related labels:
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