<?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: Downloading images - PHP in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131315#M3836</link>
    <description>&lt;P&gt;I think you want this:&lt;/P&gt;
&lt;PRE&gt;$filename = 'Glide1.jpeg';&lt;BR /&gt;$input = '/Scouts/Images/'.$filename;&lt;BR /&gt;$output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;&lt;BR /&gt;&lt;BR /&gt;$f = fopen($output, "w+b"); // write to $output&lt;BR /&gt;$fileImage = $dbxClient-&amp;gt;getFile($input, $f);&lt;BR /&gt;fclose($f);&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Oct 2015 01:45:15 GMT</pubDate>
    <dc:creator>Steve M.</dc:creator>
    <dc:date>2015-10-21T01:45:15Z</dc:date>
    <item>
      <title>Downloading images - PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131314#M3835</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to download an image with the dropbox SDK for PHP, in the future I'll hopefully use Delta to update.&lt;/P&gt;
&lt;P&gt;I'm having trouble saving the image as I'm not actually sure where the image is being stored in PHP. Currently I get a .jpeg file but it is un-openable, I presume it's actually text or something.&lt;/P&gt;
&lt;P&gt;The browser does show the image meta so I know it's successfully contacting the dropbox servers. The contents of /Dropbox-SDK are unmodified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my current code:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?php&lt;BR /&gt;&lt;BR /&gt;ini_set('display_errors',1);&lt;BR /&gt;ini_set('display_startup_errors',1);&lt;BR /&gt;error_reporting(-1);&lt;BR /&gt;&lt;BR /&gt;require_once "Dropbox-SDK/Dropbox/autoload.php";&lt;BR /&gt;use \Dropbox as dbx;&lt;BR /&gt;&lt;BR /&gt;$appInfo = dbx\AppInfo::loadFromJsonFile("Dropbox-SDK/Dropbox/config.json");&lt;BR /&gt;$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");&lt;BR /&gt;&lt;BR /&gt;$accessToken = "XXXXXXXX";&lt;BR /&gt;$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");&lt;BR /&gt;&lt;BR /&gt;//getDelta($cursor = null, $pathPrefix = null );&lt;BR /&gt;&lt;BR /&gt;//getFile($path = '/Scouts/Images/Glide1.jpeg', $outStream = $login, $rev = null );&lt;BR /&gt;&lt;BR /&gt;$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");&lt;BR /&gt;&lt;BR /&gt;$filename = 'Glide1.jpeg';&lt;BR /&gt;$input = '/Scouts/Images/'.$filename;&lt;BR /&gt;$output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;&lt;BR /&gt;&lt;BR /&gt;$f = fopen($filename, "w+b");&lt;BR /&gt;$fileImage = $dbxClient-&amp;gt;getFile($input, $f);&lt;BR /&gt;fclose($f);&lt;BR /&gt;print_r ($fileImage);&lt;BR /&gt;if(file_put_contents($output, $fileImage)){echo '&amp;lt;hr/&amp;gt;File saved successfully!';}&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:39:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131314#M3835</guid>
      <dc:creator>Roshan B.1</dc:creator>
      <dc:date>2019-05-29T09:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading images - PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131315#M3836</link>
      <description>&lt;P&gt;I think you want this:&lt;/P&gt;
&lt;PRE&gt;$filename = 'Glide1.jpeg';&lt;BR /&gt;$input = '/Scouts/Images/'.$filename;&lt;BR /&gt;$output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;&lt;BR /&gt;&lt;BR /&gt;$f = fopen($output, "w+b"); // write to $output&lt;BR /&gt;$fileImage = $dbxClient-&amp;gt;getFile($input, $f);&lt;BR /&gt;fclose($f);&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2015 01:45:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131315#M3836</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-10-21T01:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading images - PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131316#M3837</link>
      <description>&lt;P&gt;That did the trick, thanks &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@13532C4C3505179FBF012F1C117AE2EB/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 01:57:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Downloading-images-PHP/m-p/131316#M3837</guid>
      <dc:creator>Roshan B.1</dc:creator>
      <dc:date>2015-10-21T01:57:27Z</dc:date>
    </item>
  </channel>
</rss>

