<?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: Upload Image with Dropbox API in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-Image-with-Dropbox-API/m-p/213070#M10818</link>
    <description>&lt;P&gt;Found solution by changing bytes value for httppost request&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 08:55:06 GMT</pubDate>
    <dc:creator>mmteam</dc:creator>
    <dc:date>2017-03-24T08:55:06Z</dc:date>
    <item>
      <title>Upload Image with Dropbox API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-Image-with-Dropbox-API/m-p/213066#M10817</link>
      <description>&lt;P&gt;I am not able to upload the image file content in a correct way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the file is uploaded but content is corrupted..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OrderedHashJava headers = this.getCustomHeader(this.getAccessToken());&lt;BR /&gt;headers.put(HEADERS.DROPBOX_API_SELECT_USER,u.getDropboxTeamMemeberID());&lt;BR /&gt;headers.put(HEADERS.CONTENT_TYPE, "application/octet-stream");&lt;BR /&gt;headers.put(HEADERS.DROPBOX_API_ARGUMENT, requestBody);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;byte[] bytes = this.getFileContent(file.getId());&lt;BR /&gt;&lt;BR /&gt;rtn = GeneralUtil.sendHttpPostRequestByteBody(uploadURL, "", "", bytes, headers);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am passing bytes and the file is uploaded but content is corrupt in that image file why????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Api Says we have to send data in this manner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="line number1 index0 alt2"&gt;curl -X POST &lt;A href="https://api.dropboxapi.com/2-beta-2/files/upload" target="_blank"&gt;https://api.dropboxapi.com/2-beta-2/files/upload&lt;/A&gt; \&lt;/DIV&gt;&lt;DIV class="line number2 index1 alt1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--header "Authorization: Bearer &amp;lt;access-token&amp;gt;" \&lt;/DIV&gt;&lt;DIV class="line number3 index2 alt2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--header "Content-Type: application/octet-stream" \&lt;/DIV&gt;&lt;DIV class="line number4 index3 alt1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--header "Dropbox-API-Arg: {\"path\": \"/cupcake.png\", \"mode\": \"overwrite\"}" \&lt;/DIV&gt;&lt;DIV class="line number5 index4 alt2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--data-binary &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/751975"&gt;@LOCAL&lt;/a&gt;-file.png&lt;/DIV&gt;&lt;DIV class="line number5 index4 alt2"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line number5 index4 alt2"&gt;what is &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/751975"&gt;@LOCAL&lt;/a&gt;-file.png&lt;/DIV&gt;&lt;DIV class="line number5 index4 alt2"&gt;how to create data-binary as i am sending through bytes&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anybody give me solutions .&lt;/P&gt;&lt;P&gt;it is urgent&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:24:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-Image-with-Dropbox-API/m-p/213066#M10817</guid>
      <dc:creator>mmteam</dc:creator>
      <dc:date>2019-05-29T09:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Upload Image with Dropbox API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-Image-with-Dropbox-API/m-p/213070#M10818</link>
      <description>&lt;P&gt;Found solution by changing bytes value for httppost request&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 08:55:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-Image-with-Dropbox-API/m-p/213070#M10818</guid>
      <dc:creator>mmteam</dc:creator>
      <dc:date>2017-03-24T08:55:06Z</dc:date>
    </item>
  </channel>
</rss>

