首页 > 开发 > PHP > 正文

PHP 强制下载文件代码

2024-05-04 22:08:23
字体:
来源:转载
供稿:网友
代码如下:
<?php
$filename = '1.png';
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表