Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
neunygph
9 years agoExplorer | Level 4
JavaScript SDK does not return thumbnails
I'm trying to use Dropbox SDK to retrieve an imge thumbnail with filesGetThumbnail method. I used Dropbox.filesGetThumbnail and I received the response successfully but look like it only return th...
Greg-DB
Dropbox Community Moderator
9 years ago1. The filesGetThumbnail (and any other method that returns data in the response) makes the data available in the response's fileBlob property, if you're running in the browser, and fileBinary if you're running in node.
So, for example, you can do this:
dbx.filesGetThumbnail({path: remoteFilePath})
.then(function(response) {
console.log(response);
console.log(response.rev);
console.log(response.fileBlob);
// do whatever you want with the data here, e.g.:
objectURL = URL.createObjectURL(response.fileBlob)
var downloadButton = document.createElement('a');
downloadButton.setAttribute('href', objectURL);
downloadButton.setAttribute('download', response.name);
downloadButton.setAttribute('class', 'button');
downloadButton.innerText = 'Download: ' + response.name;
document.getElementById('results').appendChild(downloadButton);
})
.catch(function(error) {
console.error(error);
});
2. I covered this a bit in your other thread, but you should use the native properties on the response project. The code example above access the "rev", for instance.
- neunygph9 years agoExplorer | Level 4
Oh I see, I did not realize the data is included in fileBlob.
Thanks Greg
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!