<?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 Download dropbox images to Netlify build folder in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-dropbox-images-to-Netlify-build-folder/m-p/367384#M20791</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm trying to retrieve images from my dropbox folder into my Jekyll build on Netlify, but the images are unreadable with the following code. I think that I'm using the wrong conversion for the contents.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dbx
  .filesListFolder({ path: "/images" })
  .then(response =&amp;gt; {
    response.entries.forEach(entry =&amp;gt; {
      const { name, path_lower } = entry;

      if (entry[".tag"] === "file") {
        dbx
          .filesDownload({ path: path_lower })
          .then(data =&amp;gt; {
            const filename = path.resolve(IMAGES_DIR, name);
            const filecontents = data.fileBinary.toString("base64");

            fs.outputFile(filename, filecontents).catch(error =&amp;gt; {
              if (error) {
                return console.log("Error: file failed to write", name, error);
              }
            });
          })
          .catch(error =&amp;gt; {
            console.log("Error: file failed to download", name, error);
          });
      }
    });
  })&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Any help will be much appreciated. Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 17:11:51 GMT</pubDate>
    <dc:creator>itsjustmyron</dc:creator>
    <dc:date>2019-09-26T17:11:51Z</dc:date>
    <item>
      <title>Download dropbox images to Netlify build folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-dropbox-images-to-Netlify-build-folder/m-p/367384#M20791</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm trying to retrieve images from my dropbox folder into my Jekyll build on Netlify, but the images are unreadable with the following code. I think that I'm using the wrong conversion for the contents.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dbx
  .filesListFolder({ path: "/images" })
  .then(response =&amp;gt; {
    response.entries.forEach(entry =&amp;gt; {
      const { name, path_lower } = entry;

      if (entry[".tag"] === "file") {
        dbx
          .filesDownload({ path: path_lower })
          .then(data =&amp;gt; {
            const filename = path.resolve(IMAGES_DIR, name);
            const filecontents = data.fileBinary.toString("base64");

            fs.outputFile(filename, filecontents).catch(error =&amp;gt; {
              if (error) {
                return console.log("Error: file failed to write", name, error);
              }
            });
          })
          .catch(error =&amp;gt; {
            console.log("Error: file failed to download", name, error);
          });
      }
    });
  })&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Any help will be much appreciated. Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 17:11:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-dropbox-images-to-Netlify-build-folder/m-p/367384#M20791</guid>
      <dc:creator>itsjustmyron</dc:creator>
      <dc:date>2019-09-26T17:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Download dropbox images to Netlify build folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-dropbox-images-to-Netlify-build-folder/m-p/367397#M20792</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/58112294/download-dropbox-images-to-netlify-build-folder" target="_blank"&gt;https://stackoverflow.com/questions/58112294/download-dropbox-images-to-netlify-build-folder&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;It looks like you already worked out &lt;A href="https://stackoverflow.com/a/58121994/1305693" target="_self"&gt;the solution on StackOverflow&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:02:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-dropbox-images-to-Netlify-build-folder/m-p/367397#M20792</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-09-26T18:02:24Z</dc:date>
    </item>
  </channel>
</rss>

