Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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.
dbx .filesListFolder({ path: "/images" }) .then(response => { response.entries.forEach(entry => { const { name, path_lower } = entry; if (entry[".tag"] === "file") { dbx .filesDownload({ path: path_lower }) .then(data => { const filename = path.resolve(IMAGES_DIR, name); const filecontents = data.fileBinary.toString("base64"); fs.outputFile(filename, filecontents).catch(error => { if (error) { return console.log("Error: file failed to write", name, error); } }); }) .catch(error => { console.log("Error: file failed to download", name, error); }); } }); })
Any help will be much appreciated. Thanks.
[Cross-linking for reference: https://stackoverflow.com/questions/58112294/download-dropbox-images-to-netlify-build-folder ]
It looks like you already worked out the solution on StackOverflow.
[Cross-linking for reference: https://stackoverflow.com/questions/58112294/download-dropbox-images-to-netlify-build-folder ]
It looks like you already worked out the solution on StackOverflow.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!