<?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: Why do I get this as response for file Download? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166512#M5997</link>
    <description>&lt;P&gt;I cleaned up your code and tried this:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?php&lt;BR /&gt;&lt;BR /&gt;$url = "https://content.dropboxapi.com/2/files/download";&lt;BR /&gt;$sAccessToken = "ACCESS_TOKEN_HERE";&lt;BR /&gt;$curl = curl_init($url);&lt;BR /&gt;$aPostData = array('path' =&amp;gt; '/PATH_TO_IMAGE_HERE.jpg');&lt;BR /&gt;$aOptions = array(&lt;BR /&gt; CURLOPT_POST =&amp;gt; true,&lt;BR /&gt; CURLOPT_HTTPHEADER =&amp;gt; array('Content-Type: ', // To force empty Content-type&lt;BR /&gt; 'Authorization: Bearer ' . $sAccessToken,&lt;BR /&gt; 'Dropbox-API-Arg: ' . json_encode($aPostData)&lt;BR /&gt; ) ,&lt;BR /&gt; CURLOPT_RETURNTRANSFER =&amp;gt; true&lt;BR /&gt; );&lt;BR /&gt;curl_setopt_array($curl, $aOptions);&lt;BR /&gt;$result = curl_exec($curl);&lt;BR /&gt;&lt;BR /&gt;$fp = fopen('out.jpg', 'w');&lt;BR /&gt;fwrite($fp, $result);&lt;BR /&gt;fclose($fp);&lt;BR /&gt;&lt;BR /&gt;?&amp;gt;&lt;/PRE&gt;
&lt;P&gt;That works fine for me and produces the image file I expect.&lt;/P&gt;
&lt;P&gt;Does this work for you too? Is the actual code you're using different?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2016 08:58:45 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-01-28T08:58:45Z</dc:date>
    <item>
      <title>Why do I get this as response for file Download?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166511#M5996</link>
      <description>&lt;P&gt;I'm using the HTTP API with PHP via it's cURL methods. I send in the correct way the request and I get a correct status (200). But as response from the request I expected the content of the file and I receive strings as this one:&lt;/P&gt;
&lt;PRE class="xdebug-var-dump"&gt;@/tmp/php5BHw8P;filename=8jh7d5.jpg;type=image/jpeg&lt;/PRE&gt;
&lt;P&gt;Am I doing something wrong?&lt;/P&gt;
&lt;P&gt;What should I do with this string?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm doing something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$curl = curl_init($url);&lt;BR /&gt; $aPostData = array('path' =&amp;gt; '/Example.jpg');&lt;BR /&gt; $aOptions = CURLOPT_POST =&amp;gt; true,&lt;BR /&gt; CURLOPT_HTTPHEADER =&amp;gt; array('Content-Type: ', // To force empty Content-type&lt;BR /&gt; 'Authorization: Bearer ' . $sAccessToken,&lt;BR /&gt; 'Dropbox-API-Arg: ' . json_encode($aPostData)&lt;BR /&gt; ),&lt;BR /&gt; CURLOPT_RETURNTRANSFER =&amp;gt; true&lt;BR /&gt; );&lt;BR /&gt; curl_setopt_array($curl, $aOptions);&lt;BR /&gt; $result = curl_exec($curl); // $result = '@/tmp/php5BHw8P;filename=8jh7d5.jpg;type=image/jpeg'&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:36:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166511#M5996</guid>
      <dc:creator>Mike V.15</dc:creator>
      <dc:date>2019-05-29T09:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get this as response for file Download?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166512#M5997</link>
      <description>&lt;P&gt;I cleaned up your code and tried this:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?php&lt;BR /&gt;&lt;BR /&gt;$url = "https://content.dropboxapi.com/2/files/download";&lt;BR /&gt;$sAccessToken = "ACCESS_TOKEN_HERE";&lt;BR /&gt;$curl = curl_init($url);&lt;BR /&gt;$aPostData = array('path' =&amp;gt; '/PATH_TO_IMAGE_HERE.jpg');&lt;BR /&gt;$aOptions = array(&lt;BR /&gt; CURLOPT_POST =&amp;gt; true,&lt;BR /&gt; CURLOPT_HTTPHEADER =&amp;gt; array('Content-Type: ', // To force empty Content-type&lt;BR /&gt; 'Authorization: Bearer ' . $sAccessToken,&lt;BR /&gt; 'Dropbox-API-Arg: ' . json_encode($aPostData)&lt;BR /&gt; ) ,&lt;BR /&gt; CURLOPT_RETURNTRANSFER =&amp;gt; true&lt;BR /&gt; );&lt;BR /&gt;curl_setopt_array($curl, $aOptions);&lt;BR /&gt;$result = curl_exec($curl);&lt;BR /&gt;&lt;BR /&gt;$fp = fopen('out.jpg', 'w');&lt;BR /&gt;fwrite($fp, $result);&lt;BR /&gt;fclose($fp);&lt;BR /&gt;&lt;BR /&gt;?&amp;gt;&lt;/PRE&gt;
&lt;P&gt;That works fine for me and produces the image file I expect.&lt;/P&gt;
&lt;P&gt;Does this work for you too? Is the actual code you're using different?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 08:58:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166512#M5997</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-01-28T08:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get this as response for file Download?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166513#M5998</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today I copied your code and hardcoded my access token and my file path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got this:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;IMG id="wysiwyg_image_54" src="https://www.dropboxforum.com/hc/user_images/LnmmOv7YJQ2bijg_KWskZQ.jpeg" alt="&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;There could be something wrong with my server?&amp;lt;/p&amp;gt;" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 07:05:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166513#M5998</guid>
      <dc:creator>Mike V.15</dc:creator>
      <dc:date>2016-01-29T07:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get this as response for file Download?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166514#M5999</link>
      <description>&lt;P&gt;Actually, it seems like the code is working correctly, and that string &lt;EM&gt;is&lt;/EM&gt; the contents of the file you're trying to download. You can double check this by downloading it manually via the&amp;nbsp;Dropbox web site.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 08:03:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Why-do-I-get-this-as-response-for-file-Download/m-p/166514#M5999</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-01-29T08:03:37Z</dc:date>
    </item>
  </channel>
</rss>

