• <bdo id='Lwl3Q'></bdo><ul id='Lwl3Q'></ul>

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

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

      <legend id='Lwl3Q'><style id='Lwl3Q'><dir id='Lwl3Q'><q id='Lwl3Q'></q></dir></style></legend>

        <tfoot id='Lwl3Q'></tfoot>

        “传输编码:分块"PHP中的标头

        quot;Transfer-Encoding: chunkedquot; header in PHP(“传输编码:分块PHP中的标头)

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

              <tfoot id='NKN3R'></tfoot>
                  <tbody id='NKN3R'></tbody>

                1. 本文介绍了“传输编码:分块"PHP中的标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将 Transfer-Encoding: chunked 标头添加到我正在输出的文件(它只是生成纯文本),但是当我添加时:

                  i want to add Transfer-Encoding: chunked header to the file that i'm outputing (its just generated plain text), but when i add:

                  header("Transfer-Encoding: chunked");
                  flush();
                  

                  浏览器不想打开文件.

                  位于 ... 的网页可能是暂时下降或可能已经移动永久转移到一个新的网址.

                  The webpage at ... might be temporarily down or it may have moved permanently to a new web address.

                  我需要做什么才能让它工作?

                  what i need to do for it to work?

                  推荐答案

                  您需要在发送的每个块中发送 Content-Length.查看 Wikipedia 以获得第一印象,分块编码的外观.它不是那么微不足道,而且在许多情况下它的尺寸过大.

                  You need to send the Content-Length with every chunk you send. Look at Wikipedia for a first impression, how a chunked encoding looks like. Its not that trivial and in many cases its oversized.

                  更新:首先,您发送标头,因为它们必须始终在任何内容之前发送(也使用分块编码).然后你发送(对于每个块)大小(十六进制),然后是内容.在每个块之后记住 flush().最后,您必须发送一个大小为零的块以确保连接正确关闭.

                  Update: First you send the headers, because they must always send before any content (also with chunked encoding). Then you send (for every chunk) the size (in hexadecimal) followed by the content. Remember flush() after every chunk. At last you must send a zero-size chunk to make sure, that the connection get closed properly.

                  它没有经过测试,但是是这样的

                  Its not tested, but something like this

                  header("Transfer-Encoding: chunked");
                  echo "5
                  ";
                  echo "Hello";
                  echo "
                  
                  ";
                  flush();
                  echo "5
                  ";
                  echo "World";
                  echo "
                  ";
                  flush();
                  echo "0
                  
                  ";
                  flush();
                  

                  这篇关于“传输编码:分块"PHP中的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                2. <small id='GPLKd'></small><noframes id='GPLKd'>

                    <bdo id='GPLKd'></bdo><ul id='GPLKd'></ul>

                            <tbody id='GPLKd'></tbody>

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