<?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: Display image from Dropbox to a webpage in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523289#M1907</link>
    <description>&lt;P&gt;[Cross-linking for reference: &lt;A href="https://stackoverflow.com/questions/67710163/display-image-from-dropbox-to-a-webpage" target="_blank"&gt;https://stackoverflow.com/questions/67710163/display-image-from-dropbox-to-a-webpage&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see from your StackOverflow post that you already sorted this out.&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 17:11:05 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2021-05-28T17:11:05Z</dc:date>
    <item>
      <title>Display image from Dropbox to a webpage</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523223#M1905</link>
      <description>&lt;P&gt;So, I am trying to display an image on my web application. I am getting this image from a Dropbox folder. I want to get a URL I could use to show the image in HTML using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;src&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;attribute.&lt;/P&gt;
&lt;P&gt;I have written this code:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;downloadFile&lt;/SPAN&gt;() &lt;/SPAN&gt;{
  &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; Dropbox = &lt;SPAN class="hljs-built_in"&gt;require&lt;/SPAN&gt;(&lt;SPAN class="hljs-string"&gt;'dropbox'&lt;/SPAN&gt;).Dropbox;
  &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; ACCESS_TOKEN = &lt;SPAN class="hljs-string"&gt;"XXXXXXXXXXX"&lt;/SPAN&gt;; &lt;SPAN class="hljs-comment"&gt;// Here the access token key&lt;/SPAN&gt;
  &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; dbx = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; Dropbox({ &lt;SPAN class="hljs-attr"&gt;accessToken&lt;/SPAN&gt;: ACCESS_TOKEN });

  dbx.filesDownload({ &lt;SPAN class="hljs-attr"&gt;path&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;'/desiredImg.jpg'&lt;/SPAN&gt; })
    .then(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;response&lt;/SPAN&gt;) &lt;/SPAN&gt;{
      &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; results = &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.getElementById(&lt;SPAN class="hljs-string"&gt;'results'&lt;/SPAN&gt;);
      &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; img = &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.createElement(&lt;SPAN class="hljs-string"&gt;'img'&lt;/SPAN&gt;);
      img.src=&lt;SPAN class="hljs-built_in"&gt;window&lt;/SPAN&gt;.URL.createObjectURL(response.fileBlob);
      &lt;SPAN class="hljs-built_in"&gt;console&lt;/SPAN&gt;.log(response);
      &lt;SPAN class="hljs-built_in"&gt;console&lt;/SPAN&gt;.log(response.fileBlob);
    })
    .catch(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;error&lt;/SPAN&gt;) &lt;/SPAN&gt;{
      &lt;SPAN class="hljs-built_in"&gt;console&lt;/SPAN&gt;.error(error);
    });
  &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt; &lt;SPAN class="hljs-literal"&gt;false&lt;/SPAN&gt;;
}&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Result" style="width: 369px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/23692iB92C5AEDBE5E8E1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lAKCq.png" alt="Result" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Result&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="error" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/23693i65C52D4253F064AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OBJTS.png" alt="error" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;error&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Can anyone help me figure this out?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:17:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523223#M1905</guid>
      <dc:creator>HRania</dc:creator>
      <dc:date>2021-06-01T17:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Display image from Dropbox to a webpage</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523289#M1907</link>
      <description>&lt;P&gt;[Cross-linking for reference: &lt;A href="https://stackoverflow.com/questions/67710163/display-image-from-dropbox-to-a-webpage" target="_blank"&gt;https://stackoverflow.com/questions/67710163/display-image-from-dropbox-to-a-webpage&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see from your StackOverflow post that you already sorted this out.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 17:11:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523289#M1907</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-28T17:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Display image from Dropbox to a webpage</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523484#M1912</link>
      <description>&lt;P&gt;Yes, Thank you&lt;/P&gt;&lt;P&gt;I Forgot to mention that .&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 23:17:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Display-image-from-Dropbox-to-a-webpage/m-p/523484#M1912</guid>
      <dc:creator>HRania</dc:creator>
      <dc:date>2021-05-29T23:17:16Z</dc:date>
    </item>
  </channel>
</rss>

