1. <tfoot id='KMsg5'></tfoot>

      • <bdo id='KMsg5'></bdo><ul id='KMsg5'></ul>
      <i id='KMsg5'><tr id='KMsg5'><dt id='KMsg5'><q id='KMsg5'><span id='KMsg5'><b id='KMsg5'><form id='KMsg5'><ins id='KMsg5'></ins><ul id='KMsg5'></ul><sub id='KMsg5'></sub></form><legend id='KMsg5'></legend><bdo id='KMsg5'><pre id='KMsg5'><center id='KMsg5'></center></pre></bdo></b><th id='KMsg5'></th></span></q></dt></tr></i><div id='KMsg5'><tfoot id='KMsg5'></tfoot><dl id='KMsg5'><fieldset id='KMsg5'></fieldset></dl></div>

    1. <small id='KMsg5'></small><noframes id='KMsg5'>

    2. <legend id='KMsg5'><style id='KMsg5'><dir id='KMsg5'><q id='KMsg5'></q></dir></style></legend>
    3. PHP readfile() 和大量下载

      时间:2023-08-20
    4. <tfoot id='3BoOG'></tfoot>

        <tbody id='3BoOG'></tbody>
      <legend id='3BoOG'><style id='3BoOG'><dir id='3BoOG'><q id='3BoOG'></q></dir></style></legend>

        <small id='3BoOG'></small><noframes id='3BoOG'>

      • <i id='3BoOG'><tr id='3BoOG'><dt id='3BoOG'><q id='3BoOG'><span id='3BoOG'><b id='3BoOG'><form id='3BoOG'><ins id='3BoOG'></ins><ul id='3BoOG'></ul><sub id='3BoOG'></sub></form><legend id='3BoOG'></legend><bdo id='3BoOG'><pre id='3BoOG'><center id='3BoOG'></center></pre></bdo></b><th id='3BoOG'></th></span></q></dt></tr></i><div id='3BoOG'><tfoot id='3BoOG'></tfoot><dl id='3BoOG'><fieldset id='3BoOG'></fieldset></dl></div>

            • <bdo id='3BoOG'></bdo><ul id='3BoOG'></ul>
              • 本文介绍了PHP readfile() 和大量下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在设置在线文件管理系统时,现在遇到了障碍.

                While setting up an online file management system, and now I have hit a block.

                我正在尝试使用此 修改后的文件将文件推送到客户端读取文件的版本:

                function readfile_chunked($filename,$retbytes=true) { 
                   $chunksize = 1*(1024*1024); // how many bytes per chunk 
                   $buffer = ''; 
                   $cnt =0; 
                   // $handle = fopen($filename, 'rb'); 
                   $handle = fopen($filename, 'rb'); 
                   if ($handle === false) { 
                       return false; 
                   } 
                   while (!feof($handle)) { 
                       $buffer = fread($handle, $chunksize); 
                       echo $buffer; 
                       ob_flush(); 
                       flush(); 
                       if ($retbytes) { 
                           $cnt += strlen($buffer); 
                       } 
                   } 
                       $status = fclose($handle); 
                   if ($retbytes && $status) { 
                       return $cnt; // return num. bytes delivered like readfile() does. 
                   } 
                   return $status; 
                }
                

                但是当我尝试下载 13 MB 的文件时,它的大小刚好达到 4 MB.这里会出现什么问题?这绝对不是任何形式的时间限制,因为我在本地网络上工作,速度不是问题.

                But when I try to download a 13 MB file, it's just breaking at 4 MB. What would be the issue here? It's definitely not the time limit of any kind because I am working on a local network and speed is not an issue.

                PHP 中的内存限制设置为 300 MB.

                The memory limit in PHP is set to 300 MB.

                感谢您的帮助.

                推荐答案

                您很可能达到了 Web 服务器设置的响应缓冲区限制.众所周知,IIS 和 FastCGI 的默认缓冲区大小为 4mb.我将通过查看网络服务器<->PHP SAPI 配置来开始您的搜索.

                Most likely you are hitting the response buffer limit set by your webserver. IIS and FastCGI are known to have 4mb as the default buffer size. I would start your search with looking into the webserver<->PHP SAPI configuration.

                这篇关于PHP readfile() 和大量下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何使用 PHP 和 Mysql DB 下载文件 下一篇:强制浏览器下载文件而不是打开文件

                相关文章

              • <small id='3kanJ'></small><noframes id='3kanJ'>

                <legend id='3kanJ'><style id='3kanJ'><dir id='3kanJ'><q id='3kanJ'></q></dir></style></legend>

                <i id='3kanJ'><tr id='3kanJ'><dt id='3kanJ'><q id='3kanJ'><span id='3kanJ'><b id='3kanJ'><form id='3kanJ'><ins id='3kanJ'></ins><ul id='3kanJ'></ul><sub id='3kanJ'></sub></form><legend id='3kanJ'></legend><bdo id='3kanJ'><pre id='3kanJ'><center id='3kanJ'></center></pre></bdo></b><th id='3kanJ'></th></span></q></dt></tr></i><div id='3kanJ'><tfoot id='3kanJ'></tfoot><dl id='3kanJ'><fieldset id='3kanJ'></fieldset></dl></div>
                  • <bdo id='3kanJ'></bdo><ul id='3kanJ'></ul>
                  1. <tfoot id='3kanJ'></tfoot>