<?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: PHP file download returns page not found in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264272#M15477</link>
    <description>The output you shared is from the response. Can you inspect the request itself?</description>
    <pubDate>Fri, 09 Feb 2018 16:55:57 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-02-09T16:55:57Z</dc:date>
    <item>
      <title>PHP file download returns page not found</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264177#M15462</link>
      <description>&lt;P&gt;using cURL in PHP to call the /files/download api.&amp;nbsp; Dropbox returns "&lt;FONT size="2"&gt;Error (4xx)&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;We can't find the page you're looking for."&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;How to troubleshoot? I think I am using the API correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function getTextFile( $token )
{
  $ch = curl_init();

  curl_setopt($ch, CURLOPT_URL, "https://content.dropboxapi.com/2/files/download");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0 ) ;

  $headers = array();
  $headers[] = "Authorization: Bearer " . $token ;
  $headers[] = "Dropbox-Api-Arg: {\"path\": \"/test_upload.txt\"}";
  $headers[] = 'Content-Type: text/plain; charset=utf-8' ;
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  curl_close ($ch);
  return $result ;
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:15:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264177#M15462</guid>
      <dc:creator>steve_lae0901</dc:creator>
      <dc:date>2019-05-29T09:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: PHP file download returns page not found</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264181#M15464</link>
      <description>I don't see anything clearly wrong here. (We recommend not disabling SSL verification though.)&lt;BR /&gt;&lt;BR /&gt;Anyway, it's possible to get that generic 4xx error if the HTTP request itself is malformed. For example, perhaps $token is leaking an invalid value into the Authorization header. Can you check that it is the access token string only?</description>
      <pubDate>Thu, 08 Feb 2018 21:54:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264181#M15464</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-02-08T21:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: PHP file download returns page not found</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264191#M15466</link>
      <description>&lt;P&gt;Thanks for the help Greg.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run this code on a PHP hosting site and it works. Run it on our production ZEND PHP server and it fails.&amp;nbsp; &amp;nbsp; So I do not know what to do.&amp;nbsp; For now I am going to have the hosting site get the files from dropbox. Then use cURL to send the data from the hosting site&amp;nbsp; to the production server.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I ran the code with CURLOPT_HEADERFUNCTION.&amp;nbsp; Got this back:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; HTTP/1.1 400 Bad Request&amp;nbsp;&lt;BR /&gt;Server: nginx&amp;nbsp;&lt;BR /&gt;Date: Thu, 08 Feb 2018 22:26:12 GMT&amp;nbsp;&lt;BR /&gt;Content-Type: text/html&amp;nbsp;&lt;BR /&gt;Content-Length: 25658&amp;nbsp;&lt;BR /&gt;Connection: close&amp;nbsp;&lt;BR /&gt;ETag: "5a0b785f-643a"&amp;nbsp;&lt;BR /&gt;X-Dropbox-Request-Id: 0acd4bd5e915ad747d40dfaff467b9ca&amp;nbsp;&lt;BR /&gt;X-Robots-Tag: noindex, nofollow, noimageindex&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Feb 2018 22:40:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264191#M15466</guid>
      <dc:creator>steve_lae0901</dc:creator>
      <dc:date>2018-02-08T22:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: PHP file download returns page not found</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264239#M15472</link>
      <description>&lt;P&gt;this PHP code works on a server running PHP 7.0.27.&amp;nbsp; It is failing on PHP 5.6.15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 13:54:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264239#M15472</guid>
      <dc:creator>steve_lae0901</dc:creator>
      <dc:date>2018-02-09T13:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: PHP file download returns page not found</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264272#M15477</link>
      <description>The output you shared is from the response. Can you inspect the request itself?</description>
      <pubDate>Fri, 09 Feb 2018 16:55:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-file-download-returns-page-not-found/m-p/264272#M15477</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-02-09T16:55:57Z</dc:date>
    </item>
  </channel>
</rss>

