I try to download an image from my dropbox account using the filesDownload method in my vue.js application. But when I try to get the result it does not show me the option to get fileBlob only some metainformation. But I want to download the image directly to a project folder. This is my code with which I try to download it.
getImages() {
const fs = require('fs');
const Dropbox = require("dropbox").Dropbox;
let pictures2 = [];
const dbx = new Dropbox({
accessToken: '<REDACTED>'
});
dbx.filesDownload({
path: "/test/road-6576857_1920.jpg"
}).then(function(data) {
fs.writeFile(data.result.name, data.result.fileBlob, 'binary', (err) => {
console.log(data.result)
)},
)}
)}
}
I am using the latest dropbox sdk right now being 10.2.0 here is the github post for cross referencing:
https://github.com/dropbox/dropbox-sdk-js/issues/809