dropbox-sdk-js
dropbox-sdk-js copied to clipboard
Fileblob not visible with latest version of dropbox api
What is your question? 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)
)},
)}
)}
}
fileBlob is marked as not found in this case. It states unresolved variable fileBlob. This was taken from this example: Github official dropbox example Screenshots If applicable, add screenshots to help explain your question.
Versions I am using the latest version 10.2.0
[Cross-linking for reference: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Fileblob-not-visible-with-latest-version-of-dropbox-api-809/td-p/546981 ]
Can you elaborate on what you mean when you say "does not show me the option to get fileBlob"? Are you getting some sort of error?
Also, looking at your code, you should be accessing data.fileBlob (or data.fileBinary, depending on the environment), not data.result.fileBlob.
By the way, make sure you implement a .catch on the call for error handling.