当前位置:首页 > PHP教程 > PHP基础知识

PHP 强制下载文件代码

复制代码 代码如下:

<?php
$filename = '1.png';
header("content-type: application/force-download");
header('content-disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!