Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fileblob not visible with latest version of dropbox api #809

Open
jizang58 opened this issue Sep 25, 2021 · 1 comment
Open

Fileblob not visible with latest version of dropbox api #809

jizang58 opened this issue Sep 25, 2021 · 1 comment
Labels

Comments

@jizang58
Copy link

jizang58 commented Sep 25, 2021

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

@greg-db
Copy link
Contributor

greg-db commented Sep 27, 2021

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants