PHP 强制下载文件代码
程序员文章站
2022-06-03 10:13:44
复制代码 代码如下:
<?php
$filename = '1.png';
header("content-type: application/force-download");
header('content-disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>
复制代码 代码如下:
<?php
$filename = '1.png';
header("content-type: application/force-download");
header('content-disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>