<?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: http header issue with file send via php curl in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/http-header-issue-with-file-send-via-php-curl/m-p/397930#M21816</link>
    <description>&lt;P&gt;According to &lt;A href="https://www.php.net/manual/en/function.curl-setopt.php" target="_self"&gt;the PHP curl documentation&lt;/A&gt;, the 'CURLOPT_HEADER' option is to "to include the header in the output". It doesn't set the headers for the request. You should use the 'CURLOPT_HTTPHEADER' option for that instead.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2020 16:34:34 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-02-19T16:34:34Z</dc:date>
    <item>
      <title>http header issue with file send via php curl</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/http-header-issue-with-file-send-via-php-curl/m-p/397814#M21808</link>
      <description>&lt;P&gt;I keep getting errors in my php code regarding a missing authorization header in my http request using curl. This is what my code looks like:&lt;/P&gt;
&lt;P&gt;$doc = $_FILES['Resume'];&lt;BR /&gt;$filename = $doc['tmp_name'];&lt;BR /&gt;$dropbox_token = "token";&lt;BR /&gt;$dropbox_url = "&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank" rel="noopener"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;";&lt;BR /&gt;/*$dropbox_api_headers = array('Authorization: Bearer '. $dropbox_token,&lt;BR /&gt;'Content-Type: application/octet-stream',&lt;BR /&gt;'Dropbox-API-Arg: '.&lt;BR /&gt;json_encode(&lt;BR /&gt;array(&lt;BR /&gt;"path"=&amp;gt; '/'. basename($filename),&lt;BR /&gt;"mode" =&amp;gt; "add",&lt;BR /&gt;"autorename" =&amp;gt; true,&lt;BR /&gt;"mute" =&amp;gt; false&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;);*/&lt;BR /&gt;$opendoc = fopen($filename, 'rb');&lt;BR /&gt;$docsize = $_FILES['Resume']['size'];&lt;BR /&gt;$d1curl = curl_init();&lt;BR /&gt;$timeout = 50;&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_URL, $dropbox_url);&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_TIMEOUT, $timeout);&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_HEADER, [&lt;BR /&gt;utf8_encode('Authorization: Bearer ' . $dropbox_token),&lt;BR /&gt;utf8_encode('Content-Type: application/octet-stream'),&lt;BR /&gt;utf8_encode('Dropbox-API-Arg: '.&lt;BR /&gt;json_encode(&lt;BR /&gt;array(&lt;BR /&gt;"path"=&amp;gt; '/'. basename($filename),&lt;BR /&gt;"mode" =&amp;gt; "add",&lt;BR /&gt;"autorename" =&amp;gt; true,&lt;BR /&gt;"mute" =&amp;gt; false&lt;BR /&gt;)))]);&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_POST, true);&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_POSTFIELDS, fread($opendoc, $docsize));&lt;BR /&gt;curl_setopt($d1curl, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;$dropbox_upload = curl_exec($d1curl);&lt;BR /&gt;$http_request = curl_getinfo($d1curl, CURLINFO_HTTP_CODE);&lt;BR /&gt;echo $dropbox_upload;&lt;BR /&gt;echo $http_request;&lt;BR /&gt;curl_close($d1curl);&lt;BR /&gt;fclose($opendoc);&lt;/P&gt;
&lt;P&gt;I wonder why dropbox is giving me for errors as I followed similiar instructions seen on stackoverflow for file send and also referenced the api explorer.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 14:31:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/http-header-issue-with-file-send-via-php-curl/m-p/397814#M21808</guid>
      <dc:creator>FSUInnovation</dc:creator>
      <dc:date>2020-02-19T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: http header issue with file send via php curl</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/http-header-issue-with-file-send-via-php-curl/m-p/397930#M21816</link>
      <description>&lt;P&gt;According to &lt;A href="https://www.php.net/manual/en/function.curl-setopt.php" target="_self"&gt;the PHP curl documentation&lt;/A&gt;, the 'CURLOPT_HEADER' option is to "to include the header in the output". It doesn't set the headers for the request. You should use the 'CURLOPT_HTTPHEADER' option for that instead.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 16:34:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/http-header-issue-with-file-send-via-php-curl/m-p/397930#M21816</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-19T16:34:34Z</dc:date>
    </item>
  </channel>
</rss>

