<?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: Dropbox nested files download using CURL in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-nested-files-download-using-CURL/m-p/245201#M13895</link>
    <description>It sounds like that's an issue with using `fopen` and not the Dropbox side of things, so I'm afraid I can't offer much help. You'll need to debug why you can't `fopen` your local file. (E.g., make sure the parent folders exist, that you have permission to access it, etc.)</description>
    <pubDate>Wed, 04 Oct 2017 18:28:39 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-10-04T18:28:39Z</dc:date>
    <item>
      <title>Dropbox nested files download using CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-nested-files-download-using-CURL/m-p/244985#M13856</link>
      <description>&lt;P&gt;Hi Support,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am downloading files using below function where I am able to download only root files. I am facing issue in downloading files under folder&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function dbx_get_file($token, $in_filepath, $out_filepath)
{


$out_fp = fopen($out_filepath, 'w+');

if ($out_fp === FALSE)
{
echo "fopen error; can't open $out_filepath\n";
return (NULL);
}
$url = 'https://content.dropboxapi.com/2/files/download';
$header_array = array(
'Authorization: Bearer ' . $token,
'Content-Type:',
'Dropbox-API-Arg: {"path":"' . $in_filepath . '"}'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);
curl_setopt($ch, CURLOPT_FILE, $out_fp);
$metadata = null;
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($ch, $header) use (&amp;amp;$metadata)
{
$prefix = 'dropbox-api-result:';
if (strtolower(substr($header, 0, strlen($prefix))) === $prefix)
{
$metadata = json_decode(substr($header, strlen($prefix)), true);
}
return strlen($header);
}
);
$output = curl_exec($ch);
if ($output === FALSE)
{
echo "curl error: " . curl_error($ch);
}
curl_close($ch);
&amp;nbsp;
fclose($out_fp);
return($metadata);

} // dbx_get_file()
if(isset($_GET['download']))
{
$file = $_GET['download'];
$metadata = dbx_get_file("token", '/'.$file, $file);&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In above code when file under folder is passing for example 'test/abc.png' then it shows error in fopen() + unable to open file/folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me to resolve this issue asap&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 17:12:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-nested-files-download-using-CURL/m-p/244985#M13856</guid>
      <dc:creator>krupal</dc:creator>
      <dc:date>2020-05-29T17:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox nested files download using CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-nested-files-download-using-CURL/m-p/245201#M13895</link>
      <description>It sounds like that's an issue with using `fopen` and not the Dropbox side of things, so I'm afraid I can't offer much help. You'll need to debug why you can't `fopen` your local file. (E.g., make sure the parent folders exist, that you have permission to access it, etc.)</description>
      <pubDate>Wed, 04 Oct 2017 18:28:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-nested-files-download-using-CURL/m-p/245201#M13895</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-04T18:28:39Z</dc:date>
    </item>
  </channel>
</rss>

