<?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 File download using v2 in PHP in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/319995#M18879</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Am trying to download file from dropbox using dropbox api-PHP.&lt;/P&gt;&lt;P&gt;I have a sharelink generated using dropbox api&lt;/P&gt;&lt;P&gt;$dropbox-&amp;gt;postToAPI&lt;/P&gt;&lt;P&gt;is "&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/bs69w68dwoiiu2q/img0007cade2gtw.jpg?raw=1" target="_blank"&gt;https://www.dropbox.com/s/bs69w68dwoiiu2q/img0007cade2gtw.jpg?raw=1&lt;/A&gt;&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;Am not able to download file from dropbox using&lt;/P&gt;&lt;P&gt;$dropbox-&amp;gt;download(url);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:08:39 GMT</pubDate>
    <dc:creator>TCB</dc:creator>
    <dc:date>2019-05-29T09:08:39Z</dc:date>
    <item>
      <title>File download using v2 in PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/319995#M18879</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Am trying to download file from dropbox using dropbox api-PHP.&lt;/P&gt;&lt;P&gt;I have a sharelink generated using dropbox api&lt;/P&gt;&lt;P&gt;$dropbox-&amp;gt;postToAPI&lt;/P&gt;&lt;P&gt;is "&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/bs69w68dwoiiu2q/img0007cade2gtw.jpg?raw=1" target="_blank"&gt;https://www.dropbox.com/s/bs69w68dwoiiu2q/img0007cade2gtw.jpg?raw=1&lt;/A&gt;&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;Am not able to download file from dropbox using&lt;/P&gt;&lt;P&gt;$dropbox-&amp;gt;download(url);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:08:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/319995#M18879</guid>
      <dc:creator>TCB</dc:creator>
      <dc:date>2019-05-29T09:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: File download using v2 in PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/320035#M18883</link>
      <description>&lt;P&gt;Note that&amp;nbsp;Dropbox does not have an officially supported SDK in PHP, so if you have any SDK specific questions, you will need to ask the developer who authored the SDK.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that you might be using the "kunalvarma05/dropbox-php-sdk".&amp;nbsp; If that is the case, I suggest reading their wiki page on Uploading and Downloading files (&lt;A href="https://github.com/kunalvarma05/dropbox-php-sdk/wiki/Upload-and-Download-Files" target="_blank"&gt;https://github.com/kunalvarma05/dropbox-php-sdk/wiki/Upload-and-Download-Files&lt;/A&gt;) as it has some helpful examples.&lt;/P&gt;
&lt;P&gt;Looking at your example,&amp;nbsp;there are two ways you can possibly solve your problem.&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp; Because you have already created a shared link with the API, you do not need to use the "download()" method.&amp;nbsp; The link you have posted above can be downloaded with any PHP library or function for accessing a URL on the web.&amp;nbsp; The file_get_contents() (&lt;A href="http://php.net/manual/en/function.file-get-contents.php" target="_self"&gt;http://php.net/manual/en/function.file-get-contents.php&lt;/A&gt;) method appears to be a very commonly used approach for downloading a file with a url.&lt;/P&gt;
&lt;P&gt;2) Downloading a file does not require creating a shared link first.&amp;nbsp; If you know the path of the file you wish to download,&amp;nbsp;you can use the path of the file within Dropbox to download directly. Assuming you are using the "&lt;SPAN&gt;kunalvarma05/dropbox-php-sdk", the usage would be:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;$dropbox-&amp;gt;download(&amp;lt;path of file in dropbox&amp;gt;, &amp;lt;path to save locally&amp;gt;)&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Dec 2018 08:23:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/320035#M18883</guid>
      <dc:creator>DBX_Robert</dc:creator>
      <dc:date>2018-12-27T08:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: File download using v2 in PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/320149#M18889</link>
      <description>&lt;P&gt;A third possible solution would be to use the &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file" target="_self"&gt;sharing/get_shared_link_file&lt;/A&gt;&amp;nbsp;API method.&amp;nbsp; This takes a "url" parameter that would match the shared link URL in your original post, and will return the raw bytes of the file referenced by the shared link.&amp;nbsp; This approach would be similar to my suggestion #1 in my previous reply.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 21:36:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-download-using-v2-in-PHP/m-p/320149#M18889</guid>
      <dc:creator>DBX_Robert</dc:creator>
      <dc:date>2018-12-27T21:36:24Z</dc:date>
    </item>
  </channel>
</rss>

