Hi all
I used dropbox with meteor in previous apps and everything worked fine.
Today I have a new application to make where I have to fetch files in dropbox.
I used the same code and it doesn’t work. The code is as follows:
let Dropbox = require('dropbox').Dropbox;
let dbx = new Dropbox({accessToken: '58i ... cCIe'});
dbx.filesListFolder({path: ''})
.then(function (response) {
console.log(response.result.entries)
dbx.filesDownload({path: "/INFOSITE.txt"})
.then(function (response) {
console.log(response)
let blob = response['fileBlob'];
let reader = new FileReader();
reader.addEventListener("loadend", function () {
console.log(reader.result)
});
reader.readAsText(blob);
})
.catch(function (error) {
console.log(error)
})
})
.catch(function (error) {
console.log(error);
});
And the result is the following:
Array(3)
Failed to load resource: the server responded with a status of 400 (Bad Request)
DropboxResponseError: Response failed with a 400 code
array (3) is the result of “filesListFolder”.
against “fileDownload” throws an error.
I have searched the internet and even if this problem is mentioned, I have not found anything that allows me to solve this problem.
Quelqu’un peut-il m’aider à trouver une solution. Ca m’aiderait beaucoup.
Merci
Yvan COYAUD