<?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: Download files from Dropbox using SDK Javascript in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/291579#M17810</link>
    <description>To clarify, are you getting anything in the console with this version?&lt;BR /&gt;&lt;BR /&gt;This code looks fine, but note that it supplies the file information in the 'then' callback; it does not automatically download it to local filesystem of the computer where the browser is running. &lt;BR /&gt;&lt;BR /&gt;In this code, you are appending some text to the 'results' element, and then logging out the response information to the console, if the call was successful. (You're logging out the error information if it was not successful.)&lt;BR /&gt;&lt;BR /&gt;What you do with the result is up to you. The actual file data is available in 'response.fileBlob'. There's an example of using that here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L53" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L53&lt;/A&gt;</description>
    <pubDate>Wed, 15 Aug 2018 14:40:15 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-08-15T14:40:15Z</dc:date>
    <item>
      <title>Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/287948#M17615</link>
      <description>&lt;P&gt;Hi, all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying download files from my Dropbox using SDK Javascript, but I can't. I'm calling this code from my button html, but nothing happen. Don't show error message or something. I readed about the "filesDownload" documentation and apparently is the same code for upload files (that I founded to upload files with SDK Javascript)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function downloadFile() {
      var ACCESS_TOKEN = ""; // Here the access token key
      var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
      
   
    dbx.filesDownload({ path: '/5. Productos de las LGAC/Estudiantes/Generación 2018-2020/Artículos/Ricardo-Derechos.pdf'})
        .then(function(response){
          var results = document.getElementById('results');
          results.appendChild(document.createTextNode('File Downloaded!'));
          console.log(response);
        })
        .catch(function (error) {
        console.error(error);
    });
    return false;
}&lt;/PRE&gt;&lt;P&gt;If somebody can help me to find out the problem, will be very appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:11:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/287948#M17615</guid>
      <dc:creator>Fabito</dc:creator>
      <dc:date>2019-05-29T09:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288116#M17626</link>
      <description>&lt;P&gt;What version of the JavaScript SDK are you using? If you're using the latest version, you should get this error:&lt;/P&gt;
&lt;PRE&gt;Uncaught TypeError: Dropbox is not a constructor&lt;/PRE&gt;
&lt;P&gt;from this line:&lt;/P&gt;
&lt;PRE&gt;var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });&lt;/PRE&gt;
&lt;P&gt;If you're not using the latest version, please do upgrade and switch to using this constructor:&lt;/P&gt;
&lt;PRE&gt;var dbx = new Dropbox.Dropbox({ accessToken: ACCESS_TOKEN });&lt;/PRE&gt;
&lt;P&gt;Let me know if that doesn't help.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 15:00:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288116#M17626</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-07-31T15:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288680#M17676</link>
      <description>&lt;P&gt;Hi again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The version that I was using is 4.1.1. After your message I tried change it and use this:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="prettyprint source lang-html sunlight-highlight-html linenums sunlight-highlighted"&gt;&lt;SPAN class="sunlight-plaintext"&gt;&amp;lt;script&amp;nbsp;src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also I wrote the code suggested&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var dbx = new Dropbox.Dropbox({ accessToken: ACCESS_TOKEN });&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;But nothing happen. I push the button and only the page is refreshed. Thanks for the help&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 03:01:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288680#M17676</guid>
      <dc:creator>Fabito</dc:creator>
      <dc:date>2018-08-03T03:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288797#M17686</link>
      <description>This code is working for me. Do you get any error or output in the console?&lt;BR /&gt;&lt;BR /&gt;Can you provide a more complete sample page for this issue? It sounds like you may have the button hooked up to a different event, e.g., submitting a form, or something to that effect, causing the refresh.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Aug 2018 15:27:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/288797#M17686</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-03T15:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/291442#M17807</link>
      <description>&lt;P&gt;Hi Greg&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did a new html file, and I introduced the code and apparently works. In my application doesn't show error, just the text File Downloaded after push the button, but the I can't get the file. I searched in folder downloads and nothing appears. The code is the same, adding your last comments:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script type="text/javascript"&amp;gt;
  $(document).ready(function(){
    $('#btnguardar').click(function(){
      var ACCESS_TOKEN = ""; // Here the access token key
      var dbx = new Dropbox.Dropbox({ accessToken: ACCESS_TOKEN });
      
   
   dbx.filesDownload({ path: '/5. Productos de las LGAC/Estudiantes/Generación 2018-2020/Artículos/Ricardo-Derechos.pdf'})

        .then(function(response){
           var results = document.getElementById('results');
           results.appendChild(document.createTextNode('File Downloaded!'));

           console.log(response);
       
        })
        .catch(function (error) {
        console.error(error);
    });
    return false;
})       
  });

&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;And I am using at the begining this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;link rel="stylesheet" media="screen" href="css/bootstrap.min.css"&amp;gt;
    &amp;lt;link rel="stylesheet" media="screen" href="css/stylo.css"&amp;gt;
    &amp;lt;script src="js/jquery-3.2.1.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="js/bootstrap.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;The next image is the result of push the button.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error_dropbox.png" style="width: 999px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/5363iCE3551AC365DC9D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error_dropbox.png" alt="Error_dropbox.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 04:12:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/291442#M17807</guid>
      <dc:creator>Fabito</dc:creator>
      <dc:date>2018-08-15T04:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Download files from Dropbox using SDK Javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/291579#M17810</link>
      <description>To clarify, are you getting anything in the console with this version?&lt;BR /&gt;&lt;BR /&gt;This code looks fine, but note that it supplies the file information in the 'then' callback; it does not automatically download it to local filesystem of the computer where the browser is running. &lt;BR /&gt;&lt;BR /&gt;In this code, you are appending some text to the 'results' element, and then logging out the response information to the console, if the call was successful. (You're logging out the error information if it was not successful.)&lt;BR /&gt;&lt;BR /&gt;What you do with the result is up to you. The actual file data is available in 'response.fileBlob'. There's an example of using that here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L53" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L53&lt;/A&gt;</description>
      <pubDate>Wed, 15 Aug 2018 14:40:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-files-from-Dropbox-using-SDK-Javascript/m-p/291579#M17810</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-15T14:40:15Z</dc:date>
    </item>
  </channel>
</rss>

