<?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 Upload a file via wininet with a POST in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-file-via-wininet-with-a-POST/m-p/247115#M14125</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;we are using the Dropbox REST API with OAuth2.&lt;BR /&gt;When attempting to upload a file I don't know where to put the file contents using the wininet for http way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the docs there is just a curl example&lt;/P&gt;
&lt;PRE class="last literal-block documentation__curl-example"&gt;curl -X POST https://content.dropboxapi.com/2/files/upload \
    --header "Authorization: Bearer &lt;/PRE&gt;
&lt;PRE class="last literal-block documentation__curl-example"&gt;" \
    --header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Matrices.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" \
    --header "Content-Type: application/octet-stream" \
    --data-binary @local_file.txt&lt;/PRE&gt;
&lt;P&gt;but I don't understand how to put the contents file.&lt;/P&gt;
&lt;P&gt;I see the 3 headers like in the example but what about the file ?.&lt;/P&gt;
&lt;P&gt;data-binary is put in the body ?&lt;/P&gt;
&lt;P&gt;or in the header ?&lt;/P&gt;
&lt;P&gt;and how ?&lt;/P&gt;
&lt;P&gt;I used the postman tool to reproduce the upload I was successful. The problem is that the postman put the file in the body in a binary way selecting the file with a explorer but I cannot see how and where to put it using HttpSendRequest with a POST verb.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestion to do it ?&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:18:12 GMT</pubDate>
    <dc:creator>jmsalvador</dc:creator>
    <dc:date>2019-05-29T09:18:12Z</dc:date>
    <item>
      <title>Upload a file via wininet with a POST</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-file-via-wininet-with-a-POST/m-p/247115#M14125</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;we are using the Dropbox REST API with OAuth2.&lt;BR /&gt;When attempting to upload a file I don't know where to put the file contents using the wininet for http way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the docs there is just a curl example&lt;/P&gt;
&lt;PRE class="last literal-block documentation__curl-example"&gt;curl -X POST https://content.dropboxapi.com/2/files/upload \
    --header "Authorization: Bearer &lt;/PRE&gt;
&lt;PRE class="last literal-block documentation__curl-example"&gt;" \
    --header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Matrices.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" \
    --header "Content-Type: application/octet-stream" \
    --data-binary @local_file.txt&lt;/PRE&gt;
&lt;P&gt;but I don't understand how to put the contents file.&lt;/P&gt;
&lt;P&gt;I see the 3 headers like in the example but what about the file ?.&lt;/P&gt;
&lt;P&gt;data-binary is put in the body ?&lt;/P&gt;
&lt;P&gt;or in the header ?&lt;/P&gt;
&lt;P&gt;and how ?&lt;/P&gt;
&lt;P&gt;I used the postman tool to reproduce the upload I was successful. The problem is that the postman put the file in the body in a binary way selecting the file with a explorer but I cannot see how and where to put it using HttpSendRequest with a POST verb.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestion to do it ?&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:18:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-file-via-wininet-with-a-POST/m-p/247115#M14125</guid>
      <dc:creator>jmsalvador</dc:creator>
      <dc:date>2019-05-29T09:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a file via wininet with a POST</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-file-via-wininet-with-a-POST/m-p/247241#M14141</link>
      <description>&lt;P&gt;The &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload&lt;/A&gt;&amp;nbsp;endpoint&amp;nbsp;is a &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_self"&gt;"content-upload" style&lt;/A&gt;&amp;nbsp;endpoint, so it does expect the file data for the upload in the request body. That is what curl's "--data-binary" does. (I.e., in the example, that's how you specify what data or file curl should use for the request body.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't offer support for and don't have a sample for&amp;nbsp;WinINet/HttpSendRequest specifically unfortunately though, so you'll need to refer to the documentation for that for instructions on how to configure a request using that with the desired data in the body.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 17:16:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-file-via-wininet-with-a-POST/m-p/247241#M14141</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-16T17:16:15Z</dc:date>
    </item>
  </channel>
</rss>

