虚拟主机域名注册-常见问题网络编程问题 → PHP


php 下载文件 保存文件到本地的方法
作者:
function downfile($fileurl,$filename){
	ob_start();
	$size=readfile($fileurl);
	header( "Content-type:  application/octet-stream ");
	header( "Accept-Ranges:  bytes ");
	header( "Content-Disposition:  attachment;  filename= {$filename}");
	header( "Accept-Length: " .$size);
}


来源:
阅读:952
日期:2021-10-08

推荐朋友 】 【 评论 】  【 字体: 】 
上一篇:php中文字符串长度统计
下一篇:php 正则
  >> 相关文章
  没有相关文章。
发表评论


点  评: 字数0
用户名:  密码:

  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款