PHP 强制下载文件代码

(编辑:jimmy 日期: 2024/9/25 浏览:2)

复制代码 代码如下:
<?php
$filename = '1.png';
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>