首页 > 编程 > PHP > 正文

PHP 强制下载文件代码

2019-11-22 01:05:30
字体:
来源:转载
供稿:网友
复制代码 代码如下:

<?php
$filename = '1.png';
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $filename;
?>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表