<?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: download_zip api in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396203#M1011</link>
    <description>&lt;P&gt;the problem is that in the example it works, and I often get allowed memory size of bytes exhausted. I need some good sdk&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2020 16:43:29 GMT</pubDate>
    <dc:creator>Андрей Г.2</dc:creator>
    <dc:date>2020-02-11T16:43:29Z</dc:date>
    <item>
      <title>download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396173#M1009</link>
      <description>&lt;P&gt;please give me an example of working code on php for download_zip, I unfortunately did not find this&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 15:16:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396173#M1009</guid>
      <dc:creator>Андрей Г.2</dc:creator>
      <dc:date>2020-02-11T15:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396200#M1010</link>
      <description>&lt;P&gt;I don't have a sample of calling&amp;nbsp;/2/files/download_zip in PHP in particular to share. &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip" target="_self"&gt;The documentation&lt;/A&gt; has an example of calling it using command line curl though. Likewise, &lt;A href="https://dropbox.github.io/dropbox-api-v2-explorer/#files_download_zip" target="_self"&gt;the API v2 Explorer&lt;/A&gt; can build sample code for it in a few formats. You can use those as a reference to write your code on your platform using whatever HTTPS client you're using.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:39:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396200#M1010</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-11T16:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396203#M1011</link>
      <description>&lt;P&gt;the problem is that in the example it works, and I often get allowed memory size of bytes exhausted. I need some good sdk&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:43:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396203#M1011</guid>
      <dc:creator>Андрей Г.2</dc:creator>
      <dc:date>2020-02-11T16:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396228#M1012</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We don't have an official PHP SDK for Dropbox API v2, but another option is to use a third party library. We have some listed here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/communitysdks" rel="noreferrer" target="_blank"&gt;https://www.dropbox.com/developers/documentation/communitysdks&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I don't know which, if any, of those happen to implement /2/files/download_zip though.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 17:58:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396228#M1012</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-11T17:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396235#M1013</link>
      <description>&lt;PRE&gt;function dropbox_download_zip($folder_path, $file_name)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://content.dropboxapi.com/2/files/download_zip');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);

    $headers = array();
    $headers[] = "Authorization: Bearer " . DROPBOX_TOKEN . "";
    $headers[] = "Dropbox-API-Arg: {\"path\": \"$folder_path\"}";
    $headers[] = "Content-Type: application/octet-stream; charset=utf-8";
    $headers[] = "User-Agent: api-explorer-client";
    $headers[] = "Content-Length: 0";
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Error:' . curl_error($ch);
    } else {
        $zip_file_name = $file_name . '.zip';

        header('Content-type: application/zip');
        header('Content-Disposition: attachment; filename=' . $zip_file_name);
        header('Content-Length: ' . strlen($result));
        echo $result;


        die();
    }
}&lt;/PRE&gt;&lt;P&gt;I have this code but for large files (eg 300mb) there is an error 'allowed memory size of bytes exhausted', I think it is due to the large file size,&lt;BR /&gt;please tell me how you can make curl result immediately written to zip file&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 18:15:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396235#M1013</guid>
      <dc:creator>Андрей Г.2</dc:creator>
      <dc:date>2020-02-11T18:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: download_zip api</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396290#M1014</link>
      <description>&lt;P&gt;I can't really help with memory management on your system or with configuring third party clients as they're not made by Dropbox. That said, if you want to use curl to save to a local file on your server's local filesytem, you may want to use the 'CURLOPT_FILE' option.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 20:05:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/download-zip-api/m-p/396290#M1014</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-11T20:05:52Z</dc:date>
    </item>
  </channel>
</rss>

