<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Ziping 1GB folder and downloading it as client in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Ziping-1GB-folder-and-downloading-it-as-client/m-p/549218#M26141</link>
    <description>&lt;P&gt;So I have found a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;header("Content-Type: application/zip");
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition:attachment;filename=" . $album-&amp;gt;name . '.zip');

$opts = [
    'http' =&amp;gt; [
        'method' =&amp;gt; "POST",
        'header' =&amp;gt; "Authorization: Bearer TOKEN\r\n" .
            "Dropbox-API-Arg: ".json_encode([
                "path" =&amp;gt; $path
            ])."\r\n",
        'body' =&amp;gt; ''
    ]
];

$context = stream_context_create($opts);
$fp = fopen('https://content.dropboxapi.com/2/files/download_zip', 'r', false, $context);
fpassthru($fp);
exit();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which essentialy streams output of dropbox endpoint directly to a client, without a need to store it to memory.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 21:16:39 GMT</pubDate>
    <dc:creator>MarekKonderla</dc:creator>
    <dc:date>2021-10-06T21:16:39Z</dc:date>
    <item>
      <title>Ziping 1GB folder and downloading it as client</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Ziping-1GB-folder-and-downloading-it-as-client/m-p/549213#M26140</link>
      <description>&lt;P&gt;Hi, I have been experimenting with dropbox api on my PHP project and everything is working fine, until I try download bigger folders (cca 1GB). The downloadZip method from SDK is returning a huge body, which cannot be printed (due to memory limit), so I have used fpassthru and succesfully downloaded zip as client, but there is a still huge amount of time consumed by the act of server downloading the response, which brings me to my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a possibility in node js or php to start downloading file while script fetches data from dropbox?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I would to start downloading instantly, but I am not even sure if it is possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also open to other solutions&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 20:35:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Ziping-1GB-folder-and-downloading-it-as-client/m-p/549213#M26140</guid>
      <dc:creator>MarekKonderla</dc:creator>
      <dc:date>2021-10-06T20:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Ziping 1GB folder and downloading it as client</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Ziping-1GB-folder-and-downloading-it-as-client/m-p/549218#M26141</link>
      <description>&lt;P&gt;So I have found a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;header("Content-Type: application/zip");
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition:attachment;filename=" . $album-&amp;gt;name . '.zip');

$opts = [
    'http' =&amp;gt; [
        'method' =&amp;gt; "POST",
        'header' =&amp;gt; "Authorization: Bearer TOKEN\r\n" .
            "Dropbox-API-Arg: ".json_encode([
                "path" =&amp;gt; $path
            ])."\r\n",
        'body' =&amp;gt; ''
    ]
];

$context = stream_context_create($opts);
$fp = fopen('https://content.dropboxapi.com/2/files/download_zip', 'r', false, $context);
fpassthru($fp);
exit();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which essentialy streams output of dropbox endpoint directly to a client, without a need to store it to memory.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 21:16:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Ziping-1GB-folder-and-downloading-it-as-client/m-p/549218#M26141</guid>
      <dc:creator>MarekKonderla</dc:creator>
      <dc:date>2021-10-06T21:16:39Z</dc:date>
    </item>
  </channel>
</rss>

