php实现下载功能,android浏览器有些行,有些不行。什么问题??

床上等您 2014-10-10 08:20:49
php实现一个下载文件功能,就是header,然后echo文件内容,功能很简单。

在pc端下载,是100%成功的。

在android端:

其中一台手机:uc下载不行,不管文件大小,qq浏览器可以

其中一台,uc可以,自带浏览器不行。


下载不行:uc直接提示下载失败,什么原因没有提示出来。

为什么会这样的?与客户端有关吗?

或者是我发送的header有问题?

付上我的header代码,根据ci里的修改的
function xxooxxoo($filename, $mime=null, $len=0)
{
header('Content-Type: "' . $mime . '"');
header('Content-Disposition: attachment; filename="' . $filename . '"');

if (strpos(I('server.HTTP_USER_AGENT'), 'MSIE') !== false) {
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Content-Transfer-Encoding: binary");
header('Pragma: public');
}
else {
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
}

if($len) {
header("Content-Length: " . $len);
}

return true;
}
...全文
167 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
junlong962464 2014-10-11
  • 打赏
  • 举报
回复
我也不知道,估计是人挺少的
床上等您 2014-10-11
  • 打赏
  • 举报
回复
没人帮忙吗。。。

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧