<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                我想下載一個帶有curl的遠程文件,并立即將其輸出給用戶.用戶應該認為他從我的服務器而不是遠程服務器下載文件.我無法緩沖整個文件,因為有些文件大于200MB.此外,用戶必須等待完成緩沖,直到他可以開始下載文件.我找到了一個直接從遠程服務器下載文件的腳本:<?php$file_name=$ 我想下載一個帶有curl的遠程文件,并立即將其輸出給用戶. 用戶應該認為他從我的服務器而不是遠程服務器下載文件.我無法緩沖整個文件,因為有些文件大于200 MB.此外,用戶必須等待完成緩沖,直到他可以開始下載文件. 我找到了一個直接從遠程服務器下載文件的腳本: ``` <?PHP $file_name = $_GET['file']; $file_url = 'http://www.remote.tld/' . $file_name; header('Content-Type: application/octet-stream'); header("Content-transfer-encoding: Binary"); header("Content-disposition: attachment; filename=\"".$file_name."\""); readfile($file_url); exit; ?> ``` 這種直接遠程下載也可以卷曲嗎? 解決方法: 您需要以塊的形式讀取和輸出文件,因為整個200MB文件可能不適合您的PHP腳本的內存. 有關如何在curl中執行此操作,請參閱this question.在the manual有一個現實的例子.被盜和修改,這樣的東西應該工作(未經測試): ``` <?PHP curl_setopt($this->curl_handle, CURLOPT_WRITEFUNCTION, "receiveResponse"); function receiveResponse($curlHandle,$data) { echo $data; // Ouput to the user $length = strlen($data); return $length; } ?> ``` 請注意,這不是一個好主意.它給服務器帶來了相對沉重的負擔 – 如果你有相當高的流量數量,那么為代表下載服務的虛榮心付出的代價是很高的.當然,200 MB下載將為您的流量賬單創建400MB!
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看