为了账号安全,请及时绑定邮箱和手机立即绑定

请问有什么方法点击链接如“下载”便出现一个弹框然后自己输入保存名字存起来呢?

请问有什么方法点击链接如“下载”便出现一个弹框然后自己输入保存名字存起来呢?

料青山看我应如是 2023-04-08 13:09:48
header("Pragma: public");header("Cache-control: max-age=".$expire);//header('Cache-Control: no-store, no-cache, must-revalidate');header("Expires: " . gmdate("D, d M Y H:i:s",time()+$expire) . "GMT");header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");header("Content-Disposition: attachment; filename=".$showname);header("Content-Length: ".$length);header("Content-type: ".$type);header('Content-Encoding: none');header("Content-Transfer-Encoding: binary" );if($content == '' ) {readfile($filename);}else {echo($content);}exit();这是http里面的一段代码,可是我用它只能读出到浏览器中。
查看完整描述

1 回答

?
绝地无双

TA贡献1946条经验 获得超4个赞

header("Content-type: application/octet-stream;");

或者修改 httpd 的 mime.types 里面对应的文件类型为 application/octet-stream


查看完整回答
反对 回复 2023-04-10
  • 1 回答
  • 0 关注
  • 86 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信