Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Tshaniii
2 years agoHelpful | Level 5
dropbox file download - dbx.filesDownload
var dbx = new Dropbox({ accessToken: dbx_access_token , fetch}); await dbx.filesDownload({ path: dbx_path }).then(async (response) => { console.log("down"); awa...
Greg-DB
Dropbox Community Moderator
2 years agoTshaniii Здравко is correct, that error is indicating that you didn't provide a valid path format. It's best to take the path value from another API call result, e.g., an entry's 'path_lower' value, but if you write the path value manually it would be of the form '/Regulatory'.
When listing a folder like that, it will return an empty list of entries if the folder is empty.
The File Access Guide may be a helpful reference for how to interact with the Dropbox filesystem.
Tshaniii
2 years agoHelpful | Level 5
I added as
var dbx = new Dropbox({ accessToken: dbx_access_token , fetch});
console.log(document.Folder.name);
await dbx.filesListFolder({ path: `/${document.Folder.name}` })
.then((response) => {
console.log(response.result.entries);
console.log('Files and folders in your Dropbox account:', response);
response.result.entries.forEach((entry) => {
console.log(entry.name, document.title);
if ((entry.name).toString() === (document.title).toString()) {
let file_id = entry.id;
console.log(file_id);
dbx.filesDownload({
path: `${file_id}`
}).then(async (response) => {
console.log("down");
await response.pipe(temporaryFileStream);
}).catch((error) => {
console.log(error);
});
}
console.log(entry.name);
});
})
.catch((error) => {
console.error(error);
});
This code may not be correct as if the folder has subfolders it might not correctly give the entries. So please suggest me how to do this?
TypeError: res.buffer is not a function
at D:\GitHubProjects\docMgtSys\document-management-system\node_modules\dropbox\cjs\src\response.js:67:11
at new Promise (<anonymous>)
at parseDownloadResponse (D:\GitHubProjects\docMgtSys\document-management-system\node_modules\dropbox\cjs\src\response.js:61:10)
at D:\GitHubProjects\docMgtSys\document-management-system\node_modules\dropbox\cjs\src\dropbox.js:146:52
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I am urgent in completing this feature. Would you be able to please help me in this.
1. App permissions
2. DocFlowController is the app name
3. has 7 folders, History is one of them
4. Inside history there will be subfolders and in them there will be files. sometimes there will be no subfolders but straightaway files.
5. so i want a code to view these files in a editor or somewhere.... i prefer editor becuase there is another feature i implement to open and edit....
please give me a code sample for this. would be a great help! 🙂
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!