douxianglu4370 2015-08-17 10:53
浏览 106

对于WAV和ZIP文件,Android上的下载大小不正确

I've created a simple download script that works flawless on desktop browsers. However when trying to download ZIP or WAV files on Android it seems to show and download only 36% of the file.. Is this a known error or am I doing something completely wrong here?

My function triggered after checks:

function forceDownload($file_to_download,$header){

    header($_SERVER['SERVER_PROTOCOL'].' 200 OK');
    header("Content-Type: ".$header);
    header("Content-Transfer-Encoding: Binary");
    header('Cache-Control: must-revalidate');
    header("Pragma: public");
    header("Content-Length: ".filesize($file_to_download));
    header("Content-Disposition: attachment;
    filename=\"".basename($file_to_download)."\"");
    ob_end_flush();
    @readfile($file_to_download);
    exit();

}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记